2

http://jsbin.com/izupek/edit#javascript,html

all 3 examples are working and parsing my date.

Ive read in https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/parse

that

RFC822 pattern is ok to parse

subset of ISO 8601 pattern is ok to parse

but none of them talks about the separators between dd mm ....

where can I find official info about the separators ?

5
  • The third string is invalid in Firefox. Jan 15, 2012 at 14:38
  • @ŠimeVidas still , where is the definition
    – Royi Namir
    Jan 15, 2012 at 14:44
  • You mean, where is it defined which formats of date-strings are valid? Jan 15, 2012 at 15:21
  • @ŠimeVidas where is the documuntation about the separators !
    – Royi Namir
    Jan 15, 2012 at 15:38
  • Well, aren't the separators defined by the date format? For instance, the format mm/dd/yyyy defines that the separator is /, and so on. Therefore, if you'd like to know which separators are valid, you have to look up which date-formats are valid. Jan 15, 2012 at 15:48

1 Answer 1

1

I found those two links on MDN:

The second document explicitely states:

The international standard date notation is

YYYY-MM-DD

where YYYY is the year in the usual Gregorian calendar, MM is the month of the year between 01 (January) and 12 (December), and DD is the day of the month between 01 and 31.

For example, the fourth day of February in the year 1995 is written in the standard notation as

1995-02-04

Judging from that, the dash (-) character is the standard separator.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.