3 ms·
+1 serialise things without the processing complexities. In general, an event is either scheduled in the future relative to a specific physical location, in wh
by andrewaylett 10y ago
+1 serialise things without the processing complexities.
In general, an event is either scheduled in the future relative to a specific physical location, in which case you want to record it with a symbolic timezone reference (in case the TZ DB changes in the meantime), or it's timed absolutely, in which case you want to record it as UTC.
The trick is knowing which events are which. If you're scheduling something for a machine, probably just use UTC. If you're machine-recording the time of an event, even if it's based on a human pushing a button, use UTC and convert back to local time for display if necessary. If the user told you what time they wanted to store, store it as local time with a symbolic timezone.
Where it gets really difficult is interoperating with systems that don't do things properly, or working within systems that don't let you do things properly.