This specification defines an extension to ECMA Date and ISO-8601 Date to enable detailed time zone rules to be set, stored and communicated across formats.

Introduction

Date objects in use on the web today allow only simple representations to denote a particular location's offset from Universal Coordinated Time (UTC). This is typically provided as a +/- offset from UTC-0 (also known as Greenwich Mean Time, or GMT) e.g., +05:30 denoting that a location is 5 hours and 30 minutes ahead of UTC +00:00 (also known as Greenwich Mean Time - GMT).

The issue with this method is not getting the correct local time for a given date. The existing methods are sufficient for this purpose. The issue is correctly converting to and from local time and UTC for all points in time - in any of the past, present and future - based on an initial time provided. This is important for defining relative dates, where a time in a given location may observe different UTC offsets according to any Daylight Savings Rules (DST) in effect or any other changes that may occur to a location's time zone over time.

Without the communication of the explicit time zone rules governing a given date and time, the ability to effectively calculate the offset of the local time to UTC or to any other time zone at any point in the past or future is lost.

This specification build on top of the ECMA Date object for the communication and stringification of time zones rules to a given date and time object with the time zone information maintained.

The TimezonedDate Interface

TBW: Relationship of TimezonedDate to ECMA TC-39 Date object

...

void setTimezone ()

This method takes one argument.

DOMString timezoneId
The time zone identifier to assign to the current object.

TBW: Define application of this value to existing Date object.

DOMString getTimezone ()

Get the time zone identifier in use within the current object.

This method takes no arguments. When called, it must return a DOMString object representing the time zone identifier.

 

new TimezonedDate();

new TimezonedDate(2010, 09, 05, 15, 30, 0, "Europe/Oslo");

 

Objects that implement the TimezonedDate interface MUST stringify as follows:

By default the stringification of the object is the value provided by the underlying ECMA Date interface minus any time zone related time zone offset. If the internal 'timezoneId' attribute is not null, the stringification of the object is the concatenation of the the response from the underlying ECMA Date interface minus any time zone indicator, the string " ", and the value of the applicable time zone offset as identified by the current internal 'timezoneId' attribute in the form "GMT+HHMM[SS]" or "GMT-HHMM[SS]". If the internal 'timezoneId' attribute is not null but cannot be identified against a known time zone identifier, the stringification of the object is the concatenation of the the response from the underlying ECMA Date interface minus any time zone indicator, the string " ", and the value of the current system's time zone offset as identified by the system's clock in the form "GMT+HHMM[SS]" or "GMT-HHMM[SS].

TBW: Relationship of stringification behavior to other ToString methods in Date objects needs to be defined.