Our online blog

Posts Tagged ‘php date’

PHP Date

Friday, May 1st, 2009

We have had a few emails asking about simple PHP dates for copyright footers and having the date as part of a navigation so we thought we would post a little info pack about PHP dates.

Adding the year as part of the copyright is a great idea as it makes one less thing you have to change each year of your website. 1 more thing of the “To do List”

The simple way of getting the date and outputing it to the screen is using the example provided from PHP.NET shown below:

Source PHP.NET

<?php
$today
=

getdate();
print_r($today);
?>

To do a year only for copyright footers like we have on our website you can use:
<?php echo date(‘Y’); ?>
Hope you find this tiny bit of code handy for your website.