|
|
|
|
|
by brewmarche
2248 days ago
|
|
Actually UTC + timezone is exactly the wrong thing for "wall clock times" (things like meetings or departures where the time at the location is relevant). The conversion to UTC will lose the original local time so you cannot retrieve it once time zone data changes, unless you perform reconversions every time you detect such a change in tzdata. And countries changing time zones happens more often than we think (and also on short notice). Thus it is important to distinguish between instants (e.g. for recording when exactly something happened after the fact) and wall clock time (e.g. for coordinating people and goods at a certain place, like meetings, concerts, departure times). For the former use UTC, for the latter use a localised time zone (e.g. Europe/Rome), not an offset time zone (e.g. not +0200). For more information Jon Skeet has written about this multiple times. |
|
A fair and therefore safer approach is to decide that by protocol the legally binding time is defined in UTC.
Your system will translate UTC times to and from any given local time using the IANA time zone database which is regularly updated. End users must be aware about the UTC time, that it is legally binding, and that the local time conversions are provided as-is.
This way the time of a meeting or deadline is protected from local governments messing around with timezone changes.
Additionally, dates are rendered in ISO8601 standard format with a proper footnote to help users learn about international standards.