http://jsbin.com/izupek/edit#javascript,html
所有 3 个示例都在工作
并解析我的日期。
我读入了https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/parse
那个
RFC822模式可以解析
ISO 8601 模式的子集可以解析
但他们都没有谈论 dd mm .... 之间的分隔符。
在哪里可以找到有关分隔符的官方信息?
最佳答案
我在 MDN 上找到了这两个链接:
第二个文档明确指出:
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
由此看来,破折号 (-
) 字符是标准分隔符。
关于javascript 日期解析分隔符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8870444/