4 ms·
That is usually fine. It is generally good for system generated times representing the past. You can store in UTC and display in in any zone. It is not good fo
by jsmith45 4y ago
That is usually fine. It is generally good for system generated times representing the past. You can store in UTC and display in in any zone.
It is not good for user entered historical times that they expect will remain exactly as they entered. Even if the user specifies a specific timezone, for long enough ago timestamps the TZDB does get occasional updates to past timezone data to better reflect what actually happened.
If the user entered 10 AM America/New_York for a long ago date, you convert it to UTC, and then the TZDB updates historical timestamp info, based on newly uncovered evidence, now it might appear as 9 AM or 11 AM or whatever.
It is also insufficient for user entered future times. If the user enters a time for an event 5 years from now in their local timezone, and the local DST rules chance, they would typically still want the event to occur at the local time, which means converting to UTC and then back won't work.