Return to Snippet

Revision: 10480
at December 31, 2008 17:25 by variantstudios


Initial Code
<script type="text/javascript">
now = new Date
theYear=now.getYear()
if (theYear < 1900)
theYear=theYear+1900
document.write(theYear)
</script>

Initial URL


Initial Description
Paste this code in your HTML to display the current year. This script is commonly used in the © copyright's current year.

Initial Title
JavaScript Current Year

Initial Tags
javascript, date

Initial Language
JavaScript