javascript 日期解析分隔符?

标签 javascript

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/

相关文章:

javascript - 使用单引号(撇号)转义将事件记录对象解析为 json

javascript - 如何将单选按钮的值导出到 Excel

javascript - Canvas HTML 加载时间

javascript - 日期差异大于预期

javascript - 使用 ui-typeahead 对对象中的值进行排序

javascript - 让 javascript 为 .xml 文件执行

javascript - 循环数组重新格式化数据结构

javascript - 如何将日期拆分为格式化的日期和时间

Javascript:计算转换为UTC的2天之间的时差

javascript - Zombie + NodeJS + Express - 使用选项卡时出错