4 ms·
For sure, but for future events to be correct I still have to store that as (plain datetime, pacific/auckland), not translated to utc at the point of creation/s
by mattdw 2y ago
For sure, but for future events to be correct I still have to store that as (plain datetime, pacific/auckland), not translated to utc at the point of creation/saving. If I store only a UTC datetime I have unrecoverable lost important information.
- burntsushi 2y agoThat's exactly why Temporal uses RFC 9557 for its `ZonedDateTime` serialization format: >> zdt = Temporal.Now.zonedDateTimeISO() >> zdt.toJSON() "2025-01-24T19:57:01.089557834-05:00[America/New_York]" >> zdt.toString() "2025-01-24T19:57:01.089557834-05:00[America/New_York]" Temporal will even check that the offset is still correct for the time zone when you deserialize.