3 ms·
The original mistake you did was let someone else handle the timezone conversion. You should probably always default to storing UTC-normalized timezoneless date
by tomp 5y ago
The original mistake you did was let someone else handle the timezone conversion. You should probably always default to storing UTC-normalized timezoneless datetimes (there's of course a number of exceptions, but generally "an instant" in the past should be translated into UTC before being stored into the database... with future dates/times, it's more ambiguous, but in any case, you should be doing the TZ conversion yourself).
- mabbo 5y agoYes, this exactly. Use timezones when displaying something to a user and otherwise not at all, imho.
- nicoburns 5y agoThis falls down if the timezones themselves change. e.g. if DST was planned, but was then cancelled. You really want to store the original time with timezone as well as UTC.