mod: update taskwarrior time conversion

This commit is contained in:
2023-11-02 15:20:50 +01:00
parent a5f6d0511c
commit eb2fef4d99
3 changed files with 10 additions and 10 deletions

View File

@@ -86,13 +86,15 @@ func TaskTimeToGoTime(t string) time.Time {
third = timestamp[4 : len(timestamp)-1]
timestamp = strings.Join([]string{first, second, third}, ":")
// TODO: identify current timezone and use correct format string (works for Europe/Berlin)
value := fmt.Sprintf("%sT%s+02:00", date, timestamp)
// FIXME: the +02:00 no longer is correct due to the time shift in CET time! it is now only +01:00
// I'll have to use a better solution, to automatically derive the correct time
value := fmt.Sprintf("%sT%s+01:00", date, timestamp)
result, err := time.Parse(time.RFC3339, value)
if err != nil {
fmt.Fprint(os.Stderr, err)
os.Exit(-1)
}
return result
return result.In(time.Local)
}
func GoTimeToTaskTime(t time.Time) string {