3 ms·
I agree, I find it a well working convention to use UTC times for everything in an app, and convert to local time zone only at the time of display when formatti
by distances 10y ago
I agree, I find it a well working convention to use UTC times for everything in an app, and convert to local time zone only at the time of display when formatting the date as a string.
- yen223 10y agoUnless you are dealing with recurring events that happen at a specific time of day, in which case you need to know the local timezone to avoid off-by-one-hour errors if daylight savings kicks in.
- distances 10y agoYes, I'm sure the use cases I've had to deal with have been very simple to start with.
- TheCoelacanth 10y agoThat works for some things, but not for others. If I set my alarm clock to 7 AM local time, you convert that to UTC, then I travel one time zone over and you wake me up at 8 AM local time, I'm going to be annoyed.
- BurningFrog 10y agoThat works, but note that it's different from using java.util.Date, which is not in UTC or any other time zone.