3 ms·
When would you want use something else than UTC for business logic? Time zones (and their related nonsense) should be a view-layer concern.
by Nullabillity 9y ago
When would you want use something else than UTC for business logic? Time zones (and their related nonsense) should be a view-layer concern.
- baddox 9y agoPerhaps because there's not always a one to one relation between a time with zone and a unix time stamp.
- zAy0LfpBZLC8mAC 9y agoBecause there actually are times that are specified in terms of local time and are not fixed to a specific timezone. Take a birthday, for a trivial example: The span of time in UTC that corresponds to someone's birthday depends on their location at the time.
- talaketu 9y agotrue that anniversaries are not fixed to timezone, but these are not timestamps, and generally not even dates. Just recurrences specified by month, day (or maybe time of day eg Armistice Day observed at 11:00am). Better example: Typically an events schedule should specify destination timezone when registering an event, so that if regulations on local timezone change, scheduled event times remain valid.
- oftenwrong 9y agoFor an example of how storing a UTC datetime for a future event can go wrong, see my comment: https://news.ycombinator.com/item?id=12988092 https://news.ycombinator.com/item?id=12988092