Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hours may not be 60 minutes due to DST. #4

Closed
mbostock opened this issue Jun 29, 2015 · 2 comments
Closed

Hours may not be 60 minutes due to DST. #4

mbostock opened this issue Jun 29, 2015 · 2 comments

Comments

@mbostock
Copy link
Member

I don’t think any current DST algorithm has non-whole-hour offset, but it was definitely true in the past:

Today clocks are almost always set one hour back or ahead, but throughout history there have been several variations, like half adjustment (30 minutes) or double adjustment (two hours), and adjustments of 20 and 40 minutes have also been used. A two-hour adjustment was used in several countries during the 1940s and elsewhere at times.

A half adjustment was sometimes used in New Zealand in the first half of the 20th century. Australia's Lord Howe Island (UTC+10:30) follows a DST schedule in which clocks are moved 30 minutes forward to UTC+11, which is Australian Eastern Daylight Time (AEDT) during DST.

@mbostock mbostock changed the title Hours may not be 60 minutes if DST offset is not a whole hour. Hours may not be 60 minutes if DST is not a whole hour. Jun 29, 2015
@mbostock mbostock changed the title Hours may not be 60 minutes if DST is not a whole hour. Hours may not be 60 minutes due to DST. Jun 29, 2015
@mbostock
Copy link
Member Author

TZ=Australia/Lord_Howe is an example of a timezone currently using a half-hour DST offset. However, it does not appear to be implemented correctly on Mac OS X:

TZ=Australia/Lord_Howe node
> new Date
Tue Jun 30 2015 02:26:01 GMT+1030 (LHST)
> new Date(2015, 2, 29)
Sun Mar 29 2015 00:00:00 GMT+1130 (LHDT)

The LHDT offset should be +1100, not +1130.

@mbostock
Copy link
Member Author

With apologies to the estimated 347 people living on Lord Howe Island but I think this is probably not worth fixing. It’s tempting to use date.setHours(date.getHours() + 1) to increment the hour field, but this isn’t implement consistently on some browsers, which could cause interval.range to go into an infinite loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant