5 ms·
Whether a Date includes the time zone is an arbitrary convention, and unfortunately some people intuitively gravitate towards one or the other. You can say tha
by smallnamespace 10y ago
Whether a Date includes the time zone is an arbitrary convention, and unfortunately some people intuitively gravitate towards one or the other.
You can say that a Date doesn't include a time zone, but then a Date no longer actually refers to a concrete time -- it needs to be combined with a time zone first. This differs from how conventional language deals with dates, which is why people don't like it. And also the point of the article -- Java's Date class is misnamed and confusing.
- zoul 10y agoNo, that’s exactly the parent’s point. Date always refers to a single concrete point in time, a time zone is only needed when parsing the date or formatting it for output.
- deleted 10y ago[deleted]
- e12e 10y agoAn offset from a certain point in time without a time zone might be better described as an abstract point in time? Given such Date-s A, B, C you could order them (with potential overlap) and talk about how far apart they were) - but would need to convert via the help of a timezone to get a concrete point in time?
- zoul 10y agoIt appears that you still think of a date without a time zone as relative, which isn’t right (IMHO). A Unix date is an absolute mark on the axis of time, time zones are just different “views” on this time.
- rocqua 10y agoWhat really helped me get this is the distinction between GMT and UTC. UTC is a universal method to describe time-instant. However, UTC is not a timezone. GMT is a timezone, specifically, it is the timezone GMT+0. Representing a time-instant in GMT for universality is wrong, representing a date (i.e. the kind of thing humans use to denote appointments in their daily life) in UTC is also wrong. Use the construct that matches the domain.