Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

BBS: Re: JavaScript on Y2K - August 21, 1998 at 00:40:38

You are here: irt.org | BBS | Re: JavaScript on Y2K [This BBS is closed]

Posted by Chan Yen Jet on August 21, 1998 at 00:40:38:

In Reply to: Re: JavaScript on Y2K posted by Martin Webb on August 20, 1998 at 03:31:19:

Actually, what I want is to display current date in dd/mm/yyyy

Below is the code:
var today = new Date ()
var year = today.getYear () + 1900
....
...
document.write (year)

I guess right now there should no problem on my the date, because is will should us 1998 (98+1900), but how about year 2000 ? What will it display after add to 1900?

What can make sure that the above code will display the correct date and what will be the best solution to this ?

Thanks.

Follow-ups:

You are here: irt.org | BBS | Re: JavaScript on Y2K [This BBS is closed]

©2018 Martin Webb