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!

vDate = new Date(); // set def

Status
Not open for further replies.

thibault

Programmer
Sep 8, 1999
44
US
vDate = new Date(); // set default date
vMonth = vDate.getMonth();
vMonth = vMonth + 1;
if (vMonth<10) vMonth = (&quot;0&quot; + vMonth.toString());
vDay = vDate.getDate();
if (vDay<10) vDay = (&quot;0&quot; + vDay.toString());
vYear = vDate.getYear();
sDate = (vMonth + &quot;/&quot; + vDay + &quot;/&quot; + vYear);
document.frmOrder.ordDate.value = sDate;

this works fine in i.e. however, in netscape it displays 100 as the century. are their any alternatives?

bobbie
thibault@hotbot.com
 
thibault,

i have that problem before, what i did is add an offset of 1900 for the Netscape user


var NS4 = (document.layers);
vYear = vDate.getYear();
if(NS4){
vYear = vYear + 1900
}

hope this helps

Chiu Chan
cchan@gefmus.com
 
bobbie,

> vYear = vDate.getYear();

vYear = vDate.getFullYear();

Good luck
-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top