Dynamic Copyright Date

Dynamic Copyright Date

Share This:

Tired of changing the copyright date in the footer of your website? With this tutorial, you’ll learn how to use php code to display the current date automatically!

Place the following code where you want the year to display:

1
<?php echo date('Y'); ?>

The result will be the current 4 digit year. If you prefer a two digit year instead, use the following:

<?php echo date('y'); ?>

An example of a copyright text line would be:

1
Copyright &copy; <?php echo date('Y'); ?> Your Website Name, All Rights Reserved.

Share This:

Related Tutorials