10 ms·
This really buries the lede, which is 'Use timestamps'.
by koboll 8y ago
This really buries the lede, which is 'Use timestamps'.
- protomyth 8y agoWell, yes, but you really need to add some information to it. The last system I worked on that really needed dates for transactions and reporting stored: local time, local time zone, local offset from UTC at time of event, and UTC time stamp. Its amazing how complicated your life can get when reporting across time zones and then mixing that with legal requirements for some reporting. Also, time zone id and local time is insufficient unless you keep reference tables that can calculate what offset was in effect at the time of the event. Save the trouble and just record it along with the time stamp.
- tirpen 8y agoWhich would have the exact same problem as UTC. For most use cases when a users enter a datetime in the future, they do not care about how many seconds from 1970-01-01 that point is, they care that it occurs at exactly 12:30 on that particular day.
- 0815test 8y agoIf you really cared about how many seconds have passed since 1970-01-01, you'd need to use TAI not UTC.
- lelf 8y agoAnd get the same problems, plus the new one, leap seconds (timestamps ignore them).
- cryptonector 8y agoIt's not. The lede is "store intended time w/ TZ, and also compute and recompute UTC timestamps as needed".