Display Current Date on WordPress with PHP

I have seen many bloggers using JavaScript to display the current day and date on their blog. However the same thing can be done using only one line of PHP. You might want to display the current date for various reasons.

For example, we often notice that News websites display the current date at the top of the site. Personally I find it quite useful because I am the type of person to always forget the date of the month.

So to display the current date, here is the php code:

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

The above code will display the date as: – The “date” function of Php can be modified to further suit your need. You can read more about the date and time customization here and here.

Divi WordPress Theme

Leave a Reply

1 Comment on "Display Current Date on WordPress with PHP"

Leave a Reply


Sort by:   newest | oldest | most voted
George Serradinho
Guest
7 years 2 months ago

This can change many things as you can do some css styling to put the date within an image. I see many sites doing this and it’s not as hard as one thinks.

wpDiscuz