check for invalid date

D

Dr J R Stockton

In comp.lang.javascript message <47b4cd6e$0$20216$5a62ac22@per-
qv1-newsreader-01.iinet.net.au>, Fri, 15 Feb 2008 10:23:49, Andrew
Poulos said:
If I check for a invalid date e.g. February 30th, 2008?

Reading the newsgroup FAQ with care should help you, provided that the
version you choose is not too recent.

Since new Date() accepts both "13/11/2008" and "11/13/2008", one
cannot rely solely on new Date() . Indeed, even if you try all
browsers that you have, you still cannot rely on it, as date string
formats are not specified in ISO/IEC 16262.

You will, therefore, need to know something about the possible formats
that you may encounter - for example, will the month always be a word
rather than a number? May it be abbreviated? How much?

XP sp2 IE6 accepts new Date("Ju 30th, 2008") giving July 30th.

Read <URL:http://www.merlyn.demon.co.uk/js-date4.htm>.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top