Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1536] ISO 8601 date string not recognized by Date constructor

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNot Our Bug
Resolution Date2015-02-05T06:09:04.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterEric
AssigneeShuo Liang
Created2015-02-04T16:41:36.000+0000
Updated2016-03-08T07:37:59.000+0000

Description

Reproduce ======== console.log(new Date("2015-01-12T12:29:11+0000")); Actual ===== 1970-01-01 00:00:00 +0000 Expected ======= 2015-01-12 12:29:11 +0000 Note that a date such as "2015-01-12T12:29:11+00:00" is recognized, i.e. with a full colon included in the timezone component. However, if the string representation of the Date object does not include a colon, why should it expect a colon? Also, Google Chrome recognizes the date without a colon, if that is of any significance.

Comments

  1. Shuo Liang 2015-02-05

    Hi, It is a standard format with colon in timezone for ISO 8601 date by W3C. http://www.w3.org/TR/NOTE-datetime. Constructor only recognise the standard format, no matter how the date display in result. Regards, Shuo

JSON Source