Gadgets, Tech tips, WordPress and Blogger Tutorials

How To Display Today’s Date on WordPress Blog

clock

Like many news and magazine websites, your blog can also display the current date on your blog header. Here’s how you can add today’s date on your WordPress blog.

Paste the following code in the header.php file of your blog theme:

<?php echo date('l jS F Y'); ?>

The above code will display today’s date like this:

Friday 26th November 2010

Date Format

You can also display the date in other formats. See examples with their corresponding date output below:

<?php echo date('jS F Y'); ?>

Display: 26th November 2010

<?php echo date('l, F j, Y'); ?>

Display: Friday, November 26, 2010

<?php echo date('F j, Y'); ?>

Display: November 26, 2010

<?php echo date('l, n/j/Y'); ?>

Display: Friday, 11/26/2010

I love <?php echo date('l'); ?>s!

Display: I love Fridays!

If you have questions or if you need help on installing the code, let me know by leaving a comment below.

Get updates delivered straight to your inbox!

Enter your email address:

One comment

  1. I’ve been following this blog for some time and just want to say that I’m happy that so many useful tips on using wordpress platform can be found here. Well done.

Leave a Reply