3 ms·
That technically doesn't work; you have to store the location, not the time zone. Standard time and DST are actually two different time zones (and are represen
by kelnos 3y ago
That technically doesn't work; you have to store the location, not the time zone. Standard time and DST are actually two different time zones (and are represented as such in software); if you were doing your scheduling in January, and said "9am on July 8th in the current time zone", then the event would get translated to the wrong time when July arrives (because "current time zone" in January is standard time, while in July it'd be DST).
If you instead just specify a location, then the hour number for the time always remains the same, and the time zone gets inferred from the location.
This also saves you from the possibility that DST rules might change for that location in the future, or that there might be a more major reshuffle, and the location gets moved to an entirely new time zone. (Like, for example, say the Chinese central government decides to stop being shitty to most of their country and allows the central and western areas of the country to be on a different time zone from Beijing.)
- SAI_Peregrinus 3y agoBut whatever you do don't assume the location must be the user's current location.
- hnav 3y agotimezones as in IANA tzdb[0], not offsets from UTC. The terminology is confusing. [0] https://en.wikipedia.org/wiki/List_of_tz_database_time_zones https://en.wikipedia.org/wiki/List_of_tz_database_time_zones