Display Current Year

Its really easy code and nothing complicated here. All of us add a copyright information to the footers of the websites that we do and also add current year. Later on our clients call up and ask us to change this to current year again. So this simple code comes handy to display the current year as per the server’s time zone.

If you use PHP Programming you can use <?php echo date(“Y”) ?>

If you use ASP Programming <%=Year(Date)%>

Happy Coding!!

Tags: , ,


One Response to “ Display Current Year ”

  1. Ruby says:

    Was wondering if you could help. I’m using a template for my website. On the website the footer still displays 2010, I wanted to update it to say 2011 and update automatically. My understanding is because I started the site in 2010 it defaults to 2010. The PHP code in the footer.php file is a long list of garble to me as I don’t write code. I would gladly add the “echo date” you wrote above, but not sure where, if at all in this format. Can you help?

    Here’s what the code is on the footer.php page:


Leave a Reply