Nice to see more people doing datetime things in Zig
As someone who has spent quite some time with this stuff, here’s one piece of advice: IIUC, your timezones are hard-coded (zig_datetime/libdate/datetime/timezones.zig at master · AS400JPLPC/zig_datetime · GitHub), correct?
While it is fine to hard-code UTC offsets or UTC itself, this won’t work for timezones. Timezones ≠ UTC offsets. Timezones are rules that specify offset from UTC for a given date/time + geolocation. They are subject to political decisions and change over time, sometimes without much warning. This is why IANA manages the timezone database; to my knowledge this is the most widely adopted reference.
UTC time zones don’t change much, except that it doesn’t take into account summer or winter time zones. to be a purist.
vendredi à 22:43 à Coordinated Universal Time correspond à
vendredi à 23:43 dans le fuseau horaire Paris (UTC+1) winter
samedi à 0:43 dans le fuseau horaire Paris (UTC+2) summer
In the timezone quotation, there should be 2 timezones, in order to solve certain problems,
the timezone doesn’t change much for Western countries or Asia Japan China South Korea Australia.
After all that, it’s a draft and free open-source.
We could very well have a JSON file that would be more malleable, and have a program that would make it possible to update, but that’s when I’ll have worked out how to solve the week problem. I started from an interesting source …
I’ve just taken over the “timezone” concept and used “timedatectl” to make it dynamic, and I’ve also solved the problem of the start and end of the year for week 53 etc.