Skip to content

Datetime range ignores +/-hh:mm timezone ISO format specification #638

@d2718nis

Description

@d2718nis

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.

Details

There is no difference in behavior between adding a time entry with a timezone set to +00:00 (UTC):

$ 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):

$ 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions