2.4.6 Date Time String Format for JSON

This section is based upon the ECMAScript 5th Edition Specification, [ECMA-262/5]. The format defined here is used only by JScript 5.8 for the Date.prototype.toJSON method.

ECMAScript defines a string interchange format for date-times based upon a simplification of the [ISO-8601] Extended Format, which is YYYY-MM-DDTHH:mm:ss.sssZ

These fields are defined in the following table:




Decimal digits of the year in the Gregorian calendar.


The character "-" (hyphen) appears literally twice in the string.


Month of the year from 01 (January) to 12 (December).


Day of the month from 01 to 31.


The character "T" appears literally in the string, to indicate the beginning of the time element.


Number of complete hours that have passed since midnight as two decimal digits.


The character ":" (colon) appears literally twice in the string.


Number of complete minutes since the start of the hour as two decimal digits.


Number of complete seconds since the start of the minute as two decimal digits.


The character "." (dot) appears literally in the string. The "." field may be omitted.


Number of complete milliseconds since the start of the second as three decimal digits. The milliseconds field may be omitted.


Time zone offset is specified as "Z" (for UTC), or either "+" or "-" followed by a time expression hh:mm

This format includes date-only forms:




It also includes time-only forms with an optional time zone offset appended:




Also included are "date-times," which may be any combination of the above.

All numbers must be decimal (base 10).

Illegal values (out-of-bounds as well as syntax errors) in a format string means that the format string is not a valid instance of this format.

Because each day both starts and ends with midnight, the two notations 00:00 and 24:00 are available to distinguish the two midnights that can be associated with one date. This means that the following two notations refer to exactly the same moment in time: 1995-02-04T24:00 and 1995-02-05T00:00

There exists no international standard that specifies abbreviations for civil time zones such as CET, EST, PDT, and so on. Sometimes the same abbreviation is even used for two very different time zones. For this reason, [ISO-8601] and this format specify entirely numeric representations of date and time.