Opened 7 years ago

Closed 7 years ago

#15029 closed defect (invalid)

timezone format does not comply with iso_8601

Reported by: marcinrybacki Owned by: Adam Peller
Priority: undecided Milestone: tbd
Component: Date Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

I want to format date to pass to web service. This is sample conversion.

var res = locale.format(date, {datePattern: "yyyy-MM-ddZ", selector: "date"});

This would return such string: 2012-03-15+0100 IMO this format is incorrent and should comply with ISO 8601 format so in this case date should be returned as 2012-03-15+01:00

Please look at http://www.lyberty.com/meta/iso_8601.htm or http://books.xmlschemata.org/relaxng/ch19-77041.html

In order to retain backward compatiblity we may not destroy existing solution, but use ZZ convention instead.

var res = locale.format(date, {datePattern: "yyyy-MM-ddZZ", selector: "date"});

Will produce 2012-03-15+01:00

Change History (2)

comment:1 Changed 7 years ago by Adam Peller

For ISO dates, please use dojo/date/stamp. It should be exactly the format you require, and the code is lighter and faster.

Last edited 7 years ago by Adam Peller (previous) (diff)

comment:2 Changed 7 years ago by Adam Peller

Resolution: invalid
Status: newclosed

datePattern follows the Java Date format spec which uses RFC822

Note: See TracTickets for help on using tickets.