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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem w/ Displaying the date

Status
Not open for further replies.

YodaMan81

Technical User
Jul 8, 2003
94
0
0
US
I am using the following line to display the date on my website:

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>

var Today = new Date();
var month = Today.getMonth() + 1;

document.write (&quot;Printed: &quot; + month + &quot;/&quot; + Today.getDate() + &quot;/&quot; + Today.getYear());

</SCRIPT>

This displays correctly in IE...however the problem is when I look up this same exact page in Netscape, the date shows up as 2/18/104

Why does it say 104 and how do I make it say 2004???


Thanks in advance.
 
Hehe... I've come across this before and just added 1900 to get the correct year. Thanks for the heads-up on this GUJUm0deL :)

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top