archives

« Bugzilla Issues Index

#161 — 15.9.1.15 time zone handling contradicts ISO 8601


+++ This bug was initially created as a clone of Bug #112 +++

I realize that ECMAScript's date time format is "based upon a simplification of" ISO 8601, but edition 5.1 actually contradicts it. Page 16, section 4.2.2.2 of ISO 8601:2004(E) defines "Complete representations" of "local time" as hhmmss and hh:mm:ss, i.e. without any time zone offset.

A comparison of the two specifications follows. Please note the examples given by ISO 8601:2004(E).

ECMA-262 edition 5.1 (p. 179):
The value of an of absent time zone offset is "Z".

ISO 8601:2004(E) (p.19):
4.3.3 Representations other than complete
For reduced accuracy, decimal or expanded representations of date and time of day, any of the representations in 4.1.2 (calendar dates), 4.1.3 (ordinal dates) or 4.1.4 (week dates) followed immediately by the time designator [T] may be combined with any of the representations in 4.2.2.2 through 4.2.2.4 (local time), 4.2.4 (UTC of day) or 4.2.5.2 (local time and the difference from UTC)...

The following are examples of reduced representations of combinations of date and time of day
representations:

a) Calendar date and local time
Basic format: YYYYMMDDThhmm Example: 19850412T1015
Extended format: YYYY-MM-DDThh:mm Example: 1985-04-12T10:15

b) Ordinal date and UTC of day
Basic format: YYYYDDDThhmmZ Example: 1985102T1015Z
Extended format: YYYY-DDDThh:mmZ Example: 1985-102T10:15Z


corrected in editor's current draft