Daylight savings time is the practice of shifting the settings of your clock during the Summer or Winter months to move some daylight time from the morning to the evening. The nature of this shift is dependent on locality and cultural issues. The time may be shifted in the Summer relative to standard time or it may be shifted in the Winter. In the UK, during the Winter, time is shifted backwards by an hour. In the USA, clocks are shifted forwards in the Summer.
An ECMA compliant implementation is expected to be able to determine the correct daylight savings time algorithm.
The algorithm is used to determine the Daylight Savings Time Adjustment value (known internally as DaylightSavingTA). This value is measured in milliseconds and must depend only on the following factors:
The time since the beginning of the year
Whether the year is a leap year
The week day of the beginning of the year
The geographic location
The ECMAScript implementation should decide whether daylight saving time would be in effect according to the currently available algorithm. Historically, daylight saving time algorithms may be different according to local political decisions and it would be too complicated trying to take that into account.
It is possible that the underling host environment provides some daylight savings time algorithm support and the standard allows that this can be used if it is available.
The standard does not specify any particular algorithm. It just mandates that the algorithm should only rely on a restricted sub-set of information.
The standard suggests that daylight savings time support is really a matter for the host environment and should be considered implementation and platform dependent. There are portability implications in that respect.
Prev | Home | Next |
Day within year | Up | Days in year |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |