There is many, may times I’ve wanted to display the current year – the most obvious spot is in the footer like with copyrights.  Having to “hand edit” your website every time the year changes is time-consuming — and frankly a bit silly.

So, you have a few options available.

1) An easy one it to just not use a year.  Frankly, it’s not needed and I’d much rather see no year than to have something that says “2003″.

Example:

© My Company Name

(FYI - the html code for the copyright (c) symbol is © )

2) You can use javacript to display the year.  Here’s the code I use:

<script language="JavaScript">
<!-- 

// Set right_now to the current date() value
right_now = new Date();

// Write out the Year
var right_year=right_now.getYear();
if (right_year < 2000)
right_year = right_year + 1900;
document.write( right_year );
-->
</script>

So you get something like this:

©


My company Name

Yep, it’s just that easy.

---------------
Cheers,
Kelly
Beaverton Web Design

Leave a Reply