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

Better time zones #25

Closed
StoneCypher opened this issue Dec 18, 2018 · 2 comments
Closed

Better time zones #25

StoneCypher opened this issue Dec 18, 2018 · 2 comments

Comments

@StoneCypher
Copy link

The current timezone mechanism afforded is occasionally reparably ambiguous.

With respect to that the problem is genuinely difficult, based on that the timezone tables vary over time, and the operating system generally does not afford to an application its own tables, making the job of verifying its worldview problematic, and with an appreciation for that Unix Time Solves Nearly All Things™, a few problems remain which need system support for appropriate resolution.

However, there are times at which I need to be able to compute a time on a different date in the local timezone, or other various tomfoolery. This isn't actually safely possible. Timezones switch on different dates, or by different distances, meaning the same computed delta could meaningfully refer to several incompatible timezones.

In my opinion, this can be repaired through simple extension. My steps to repair the timezone API would include:

  1. What is the current local timezone
    1. With daylight savings
    2. Without
  2. Are we currently in daylight savings
    1. When does that next change
    2. When did that last change
    3. Will we be in daylight savings at unixtime X
  3. What is the local current GMT delta
    1. What was the local GMT delta at unixtime X

It would possibly be equally/more useful to be able to create Date objects in specific timezones. At that point, merely adding the "is this datetime in DST" to the existing Date API would cover all of the above steps.

@ljharb
Copy link
Member

ljharb commented Dec 18, 2018

See https://github.com/tc39/proposal-temporal ; specifically, tc39/proposal-temporal#103

@StoneCypher
Copy link
Author

Oh, fantastic. My old one was long since gone and I thought I was the only one that cared

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

No branches or pull requests

2 participants