DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

Many blogs displays the current date on their blog header. It looks profesional, and it is also useful, especially if your blog posts are dated. Here is a very easy way to add today’s date on your WordPress blog.

Open your header.php file (or any other file) and paste the following code:

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

The date format can be easily formatted. You can get more info on the date() php function here.

4 Comments

  1. Thanks for a great tip on date display for WordPress sites!

  2. But, how do you place the server time where you want? I mean, I know this PHP code, but how can I display the time let’s say in the middle of a page?

  3. @Sam, you could wrap that code in a div, and then control the placement of the div

  4. For different languages, you should try the date_i18n() function.

Leave a Comment

Your email address will not be published. Required fields are marked *