anufrievroman / calcure

Modern TUI calendar and task manager with minimal and customizable UI.
https://anufrievroman.gitbook.io/calcure
MIT License
1.51k stars 43 forks source link

Use tzlocal for timezone conversions. #82

Closed jose1711 closed 9 months ago

anufrievroman commented 9 months ago

Wow, 1 line instead of 25, that's elegant!

anufrievroman commented 9 months ago

An issue I have with this implementation is that it produced this error because I had /etc/timezones listing some America/NewYork timezone (selected at install), while globally TZ was set to my actual timezone. So there is a conflict and get_timezone() returned zoneinfo.ZoneInfoNotFoundError. I can imagine this non-obvious issue might occur to many people.

We could try to except this error, but then my timezone is not taken into account and everything is in UTC.

anufrievroman commented 9 months ago

I could get a better result with a slightly different implementation: e2d10b6a95895b53f68ccb422eedf26ea670641e