-
Notifications
You must be signed in to change notification settings - Fork 8
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
library does not respect DST boundaries (no timezone awareness) #14
Comments
Yes, well, this lib is not aware of timezone at all. To be honest this is something I could use in one project, but I would have to wrap my head around timezone's and figure out way to implement it. Will think about it. You could also create PR, looks like you have better idea about handling timezone then I do.. |
@pbogut in order to implement this, I think you'd probably end up taking a dependency on something like Timex, which has a lot of functions that provide awareness of timezones. There's an issue on that project to add a recurring event function, which I chimed in on: bitwalker/timex#129 I'm not sure if there's a function that makes it easy to detect whether you've just jumped across a DST boundary, but I think that's what you'd need to detect here. An awful/inefficient way to do this is to convert the new time to UTC, then back to the named timezone and see if it matches the original offset. Ugly though :) Actually, the I may get a chance to come back to this problem in the near future. Would you be interested in adopting Timex as a dependency in order to solve this? |
I was thinking something similar, checking timezone offset every new value. There may be some edge cases when timezone actually will change date, need to check similar modules for different languages how they solve that. As for Timex I'am happy to use it as an optional dependency, I mean, if someone doesn't need timezone handling there is no reason to include Timex. |
I may be talking some rubbish, I guess date will be alrigh. There will be 2 cases, fix timezone if changed for given date (as time is actually all right), or fix time if there is interval rule for time (like every 3 hours) as that will be affected by timezone. Anything else? |
@pbogut yes, absolutely interested in helping. I'll chime in on that thread! |
In the following example:
I'm starting with a time that's just before the US daylight saving time switch (Sunday Nov 4th), and explicitly setting it to
America/Los_Angeles
(UTC-7). The correct behavior would, I think, have the following value for Nov 4th:The intention of the provided arguments is to have an event that repeats at 3am every day in the given timezone. But since this package has no timezone or DST awareness, it continues with a UTC-7 offset even though the specified zone has switched to UTC-8.
The text was updated successfully, but these errors were encountered: