-
Notifications
You must be signed in to change notification settings - Fork 838
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
DST rules not used in runtime #149
Comments
The original implementation did use the rules and zones from the IANA tzdata. We switched away from it due to poor performance, maintainability, and memory leaks. You can see the rationale for the change in #82. |
Ok, I see the problem. |
I believe that all problems with performance, maintainability, memory leaks are resolvable with support for rules in runtime. |
Do you have a specific use case for using rules, or is it just for the theoretical savings? Assuming that the timezone rules will be the same for the next 1000 to 8000 years is overly optimistic. There have already been 8 updates to the IANA tzdb this year, so it's highly unlikely the data will be the same for so long. If you are making a game that takes place in the future, write a plot point saying daylight saving time was abolished and save the headaches. :) |
Ok, example with game is not really good) |
The data is calculated from 1900 to 2038 for the You can check if a moment is in DST using moment#isDST. You can check the amount of time offset from UTC with moment#zone. |
I have looked at moment#isDST function... isDST : function () {
return (this.utcOffset() > this.clone().month(0).utcOffset() ||
this.utcOffset() > this.clone().month(5).utcOffset());
}, What if it's not a DST switch, but a historical offset switch for the timezone? |
Hi guys,
What I understand from the documentation - is that you don't use rules from IANA tzdata for daylight saving time transitions in runtime, but you copy transition for each year instead.
So, for example, instead of something like
You have
I see some big disadvantages of this approach:
If I understand correctly, you have code that parses IANA rules and generates timezone data in your format, and generally speaking we can adapt it to use rules in runtime.
So, my questions are:
Is this a deliberate approach or is it just an easy solution for now?
Do you have plans to support data with rules?
The text was updated successfully, but these errors were encountered: