-
Notifications
You must be signed in to change notification settings - Fork 35
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
arbtt-stats --dump-samples uses wrong timezone #155
Comments
I believe this might be related to #82 which seems to have been the change that introduced timezone support to |
Yes, unfortunately timezone handling is insufficient in arbtt in general; I was young and would have needed more education to have done it properly from the start. In particular, all samples are stored without a timezone (but at least, I believe, all in UTC, rather than some unknown timezone). For this particular issue, though, I think the solution is to not use
but rather use the functions from the I’ll look into it at some point in the future, unless someone beats me to it :-) |
Ah, but you return two different issues; one with the json dump, and one with the human-readable dump. Isn’t it the case that (currently) the JSON dump uses UTC consistently? (hence the |
Yes, I intentionally compared the same event from both (I'm reasonably sure that it is the same event I'm comparing because it is the first event from 2022.)
Yes, the JSON dump does it correctly because it doesn't bother with timezones at all, as far as I can tell. |
Ok, thanks for the clarification. I think I can fix that easily; I only very recently learned about this dark corner of the Haskell timezone handling… |
by using the `tz` library instead of just `time`. Fixes #155.
by using the `tz` library instead of just `time`. Fixes #155.
I'm using the
Europe/Berlin
timezone which observes DST - it uses CET (UTC+1) in winter, and CEST (UTC+2) in summer.Unfortunately,
arbtt-stats --dump-samples
always seems to use the current offset, and not the correct offset for the respective timestamp. E.g. this sample:should be displayed as 2022-01-03 23:37:16, because in January the offset of
Europe/Berlin
was CET (UTC+1).date
does it correctly:But
arbtt-stats --dump-samples
instead uses the offset CEST (UTC+2) because it is the offset of today:and therefore incorrectly displays it as 2022-01-04 00:37:16:
The text was updated successfully, but these errors were encountered: