2 ms·
> A date string is a function of a Unix timestamp and a timezone If offset or zoned. Sadly the average date string has no more inherent timezone information th
by masklinn 8y ago
> A date string is a function of a Unix timestamp and a timezone
If offset or zoned. Sadly the average date string has no more inherent timezone information than a unix timestamp.
- AgentME 8y agoI meant that a datetime string is generated from the combination of a Unix timestamp and a timezone together, not that it lossily retains both of those inputs. For example, if I want to show the time of day of an event like "3:12 AM" to the user, then I need both the Unix timestamp of the event (for example, 1558050450579) and their timezone (could be as a UTC offset, like -7) in order to produce "4:47 PM". That's true whenever I'm trying to make a string from a Unix timestamp, regardless of whether the final date/time string explicitly says its timezone.