-
Notifications
You must be signed in to change notification settings - Fork 97
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
Datetime range ignores +/-hh:mm timezone ISO format specification #638
Comments
They are different for me:
I'm using timewarrior build from d389bba |
Come to think of it, the exported zulu timestrings seem to be wrong anyways, but for a different reason: they should only differ by 4 hours (+00:00 vs +04:00), but they differ by 11 hours?!? 🤔 |
they are determined correctly by libshared:
feels like I'm missing something, but not sure what. |
Built it from sources (d389bba and GothenburgBitFactory/libshared@a63fa35), here are the results: $ ./src/timew --version
1.7.1-dev
$ t=(2024-10-23T13:{02,32}:10+0{0,4}:00)
$ ./src/timew track ${t[0]} - ${t[2]} :yes
Recorded
Started 2024-10-23T13:02:10
Ended 32:10
Total 0:30:00
$ ./src/timew track ${t[1]} - ${t[3]}
You cannot overlap intervals. Correct the start/end time, or specify the :adjust hint.
$ ./src/timew export
[
{"id":1,"start":"20241023T090210Z","end":"20241023T093210Z"}
] But then using +1hr: $ ./src/timew track 2024-10-23T14:02:10+04:00 - 2024-10-23T14:32:10+04:00
Recorded
Started 2024-10-23T14:02:10
Ended 32:10
Total 0:30:00
$ ./src/timew export
[
{"id":2,"start":"20241023T090210Z","end":"20241023T093210Z"},
{"id":1,"start":"20241023T100210Z","end":"20241023T103210Z"}
] This is also calculated correctly for me:
I feel like it is related to $ env | grep TZ
$ TZ=UTC ./src/timew track ${t[0]} - ${t[2]} :yes
Recorded
Started 2024-10-23T13:02:10
Ended 32:10
Total 0:30:00
$ TZ=UTC ./src/timew track ${t[1]} - ${t[3]} :yes
Recorded
Started 2024-10-23T09:02:10
Ended 32:10
Total 0:30:00
$ ./src/timew export
[
{"id":2,"start":"20241023T090210Z","end":"20241023T093210Z"},
{"id":1,"start":"20241023T130210Z","end":"20241023T133210Z"}
] |
Indeed it does:
I think it is definitely a bug. The local timezone should only be used when we aren't providing the timezone of the input date in the date itself. |
Summary
When adding time entries to Timewarrior, the
+/-hh:mm
timezone ISO format specification seems to be ignored, even though it is mentioned as a valid method in bothman 7 timew-dates
and the online documentation.Details
There is no difference in behavior between adding a time entry with a timezone set to
+00:00
(UTC):Or like this, with the timezone set to
+04:00
(Asia/Tbilisi):Expected behavior
Setting a datetime range with a valid timezone format should result in a correct datetime database entry, including the specified timezone if provided.
Environment
The text was updated successfully, but these errors were encountered: