4 ms·
Works great until you have an office in a different time zone. The whole concept of a computer belonging to a timezone works to some extent when that computer
by amluto 3y ago
Works great until you have an office in a different time zone.
The whole concept of a computer belonging to a timezone works to some extent when that computer has a single human tenant, but it falls apart pretty quickly when the scope broadens.
- jcranmer 3y agoIf I'm scheduling a meeting, then yes, I am going to want to schedule the meeting using a specific time zone, which may or may not be my local time zone at that moment. But if I'm scheduling when I want my computer to reboot, I want that to be a fixed in time zone in my local time zone. And if I subsequently change my local time zone, I want it to remain at that time in the new local time zone, not the old one. Yes, local time zones don't always make sense. But that is a far cry from saying they never make sense!
- amluto 3y agoI don’t know about you, but I have computers that aren’t in the same time zone I’m it. I probably want them to reboot at night where I am, not where they are. But yes, “reboot a laptop at 2am” is in the general category of alarm clock use cases, where a time (but not a date!) with a separately determined time zone makes sense. The OP mentioned LocalDateTime, which doesn’t make sense for this use case.
- falserum 3y agoInstant in history -> GMT+0/UTC Future shedule for humans to coordinate (contracts, meetings) -> ZonedDateTime Personal alarm that should be kept in sync with the sun (e.g. go to sleep) -> LocalDateTime What’s good example/purpose for OffsetDateTime?
- jcranmer 3y agoOffsetDateTime would be useful for a lot of historical records. For example, if I'm chronicling a WW2 battle in the Pacific, I need to know what the local times of the events were, but I don't necessarily care about knowing the DST rules. Additionally, most date/time serialization formats (e.g., RFC 822, ISO 3601) only allow you to specify up to OffsetDateTime and don't provide a full timezone reference like US/Eastern.