Herself's Webtools

Scripts, HowTos, Templates, Plugins, Widgets, Tips and Useful Information

Use PHP to keep the date fresh on your site

without comments

I was reading an article reminding webmasters to update the copyright date on their webpages and someone added a note about how to have PHP automatically do this for you.

To show the day of the week:

<?php echo date(“D”) ?>

To show the day of the month:

<?php echo date(“d”) ?>

To show the month:

<?php echo date(“M”) ?>

To show the year:

<?php echo date(“Y”) ?>

That is the code used in the footer at the bottom of the page to show the copyright year.

Written by timestocome

February 4th, 2008 at 5:00 am

Posted in how to

Leave a Reply

You must be logged in to post a comment.