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

Year returned in strange format

Status
Not open for further replies.

RPrinceton

Programmer
Jan 8, 2003
86
US
Hi Everyone,
The code below yields a year of 106. I think the 1 is supposed to mean 20 (a Y2K thing). I can certainly test for
the one, but is there another Javascript function to produce
a 4 digit year?
Please advise.
Regards,
RPrinceton

Javascript:
<!--BegHide
hdg = "Excellence in Software"
dtObj = new Date()
ccyy = dtObj.getYear()
hdg = "<FONT COLOR=#FFCF63 SIZE=6><CENTER>" + hdg + " " + ccyy + "</CENTER></FONT>"
document.write(hdg)
document.write("<BR>")
//EndHide-->
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top