Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you're looking in the backwards direction and its important what local time in a different location it happened, that's the use case for offset date time. Maybe you're investigating traffic patterns in which case it can be clearer when it's 6pm local time rather than noon utc or whatever. Embedding that in the returned timestamp can save another field.

However, for the forward looking/scheduling one one, if you want it to keep the same time across timezone/DST policy changes, you need to the full on timezone designator (i.e. America/New_York), not just the offset or short, ambiguous timezone code (EST).

There's no allowance in ISO 8601 for this, so you need a side channel like another field to communicate this. I've seen other date formats do something like 2021-10-11T12:13:14[America/New_York] to allow for this. Once you do this, it probably makes sense to elide the offset to avoid the risk of consfusing mismatches between it and the timezone.



As far as I know, there isn't an official standard for timezone names so you need to define which set of names you are using.


IANA tzdb is the defacto standard in the software industry.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: