I need to use time zone strings like this:
CET-1CEST,M3.5.0,M10.5.0/3
CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00
But the go time pkg is using the IANA Time Zone database e.g.: Europe/Paris
Is there perhaps a way to use or convert the strings? I want to add/subtract time differences of various zones.
You'll need to build (or find) a map of 3-letter time zones to IANA time zone that covers the time zones you'll be seeing.
The reason being that 3-letter time zones like
CET
are not guaranteed to be unique (and are, in fact, not unique).For instance,
CET
covers multiple TZDB time zones. They are all UTC+0100, but vary inAnd
PST
covers "Pacfic Standard Time" (UTC-0800/UTC-0700), covering the west coast of the USA, but it also covers Asia/Manila (UTC+0800/UTC+0800).There are lots more anomalies like that: the world is a big place, with lots of different governments and cultures.
Also, history matters: the geographic boundaries of time zones have changed over the years, as have the rules surrounding daylight savings times. So to get an accurate notion of a local time measurement relative to UTC, in addition to the local time measurement itself, you need to know not only where the measurement was taken, but when it was taken.
[and it gets worse if you have to consider the shift from the Julian to the Gregorian calendar: that took centuries to complete. Russia, for instance, didn't switch to the Gregorian calendar until after the Bolshevik Revolution at the end of the 1st world war.