Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display year

Status
Not open for further replies.

onressy

Programmer
Joined
Mar 7, 2006
Messages
421
Location
CA
Hi i have a .html page with copy wite info at the bottom, i would like to display teh current year, so i don't have to modify it every year, how can this be accomplished?
thanks
 
where you want to put the year, insert a script

<script type="text/javascript">
var d=new Date();
document.write(d.getFullYear());
</script>


I've tested this in IE and Firefox
 
This ought to do the trick... it will output the current year based on the date on the browsing client computer.
Code:
<script type="text/javascript">document.write(new Date().getFullYear());</script>
Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top