Ticket #130 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

builtins: Why is the 'Z' prefix disallowed for the Date.prototype.toISOString method?

Reported by: lth Assigned to: lth
Type: defect Priority: minor
Component: RefImpl Version: 4
Keywords: Cc: brendan, chrispi

Description

A thread on es4-discuss uncovered the fact that the toISOString proposal has a couple of bugs:

  • The time zone of the serialized time is unspecified in the proposal, it should probably be UTC. Any reason why not?
  • Being UTC, the Z suffix should be used but the proposal explicitly disallows that. Why?

The ISO reference page we use does not contain any ban on using "Z" for serialization. It could be a backwards compatibility issue: current parsers would be able to deal with a time zone, most likely, but might not deal with "Z".

Attachments

Change History

Changed 3 years ago by lth

It is in fact not likely that the "Z" prohibition is there to help current parsers, since the time stamp will contain a fractions-of-a-second part that will probably confuse current parsers just as much. This is the current output of toISOString():

2007-06-02T17:42:30.718+00:00

I note the month and day are wrong, so there are some bugs here, but you get the idea :-P

Changed 3 years ago by lth

  • summary changed from Why is the 'Z' prefix disallowed for the Date.prototype.toISOString method? to builtins: Why is the 'Z' prefix disallowed for the Date.prototype.toISOString method?

Changed 3 years ago by lth

  • owner set to lth
  • component changed from Proposals to RefImpl

Resolved: Z is OK.

Changed 3 years ago by lth

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.