Going crazy - browser date problems

WillR

Earning My Ears
Joined
Aug 19, 1999
Messages
29
Hi,

I'm going crazy trying to figure this out and hoping maybe some one knows the answer or can point me in the right direction.

I have a web site that I want to add a date to - I want it to be formatted like this: January 22, 2002.

I'm working in Dreamweaver and I found a JavaScript code that works great but only in Explorer. When I preview the page in Netscape the date looks like this: January 22, 102

Any ideas? I know my Netscape is outdates (4.51) but ideally I would like the date to work in this version since some people are still using it.

I'm pretty sure the part of the code creating the problem is this:
return months[date.getMonth()] + " " +
date.getDate() + ", " + (+ date.getYear());


Any help or suggestions are greatly appreciated.
Thanks
 
Hi,

I think I did it:

return months[date.getMonth()] + " " +
date.getDate() + ", " + (+ date.getYear());

changed to:

return months[date.getMonth()] + " " +
date.getDate() + ", " + "2002";

Seems to do the trick - at least for the rest of 2002 - I can live with that!
 















Receive up to $1,000 in Onboard Credit and a Gift Basket!
That’s right — when you book your Disney Cruise with Dreams Unlimited Travel, you’ll receive incredible shipboard credits to spend during your vacation!
CLICK HERE







New Posts







DIS Facebook DIS youtube DIS Instagram DIS Pinterest DIS Tiktok DIS Twitter

Back
Top