GothenburgBitFactory / GothenburgBitFactory/timewarrior
Datetime range ignores +/-hh:mm timezone ISO format specification
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 117
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 5
Description
## 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 both `man 7 timew-dates` and the [online documentation](https://timewarrior.net/reference/timew-dates.7/).
## Details
There is no difference in behavior between adding a time entry with a timezone set to `+00:00` (UTC):
```bash
$ timew track 2024-10-23T13:02:10+00:00 - 2024-10-23T13:32:10+00:00 'Some task'
Recorded "Some task"
Started 2024-10-23T13:02:10
Ended 32:10
Total 0:30:00
$ timew summary :ids
Wk Date Day ID Tags Start End Time Total
W43 2024-10-23 Wed @1 Some task 13:02:10 13:32:10 0:30:00
$ timew @1 export
[
{"id":1,"start":"20241023T090210Z","end":"20241023T093210Z","tags":["Some task"]}
]
```
Or like this, with the timezone set to `+04:00` (Asia/Tbilisi):
```bash
$ timew track 2024-10-23T13:02:10+04:00 - 2024-10-23T13:32:10+04:00 'Some task'
Recorded "Some task"
Started 2024-10-23T13:02:10
Ended 32:10
Total 0:30:00
$ timew summary :ids
Wk Date Day ID Tags Start End Time Total
W43 2024-10-23 Wed @1 Some task 13:02:10 13:32:10 0:30:00
$ timew @1 export
[
{"id":1,"start":"20241023T090210Z","end":"20241023T093210Z","tags":["Some task"]}
]
```
## 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
```
$ timew --version
1.7.1
$ python --version
Python 3.12.7
$ uname -a
Linux host 6.11.4-arch2-1 #1 SMP PREEMPT_DYNAMIC Sun, 20 Oct 2024 18:20:12 +0000 x86_64 GNU/Linux
$ timedatectl
Local time: Wed 2024-10-23 20:36:51 +04
Universal time: Wed 2024-10-23 16:36:51 UTC
RTC time: Wed 2024-10-23 16:36:51
Time zone: Asia/Tbilisi (+04, +0400)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
```
Contributor guide
Research direction
Start by reproducing the two `timew track` commands from the issue and compare their `timew @1 export` output. Read the `man 7 timew-dates` and online date documentation to confirm the stated syntax; done means `+00:00` and `+04:00` inputs produce database entries reflecting their specified offsets rather than identical UTC values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100