tags : Human Computer Interaction ( HCI ), Database, Clocks
This is interesting to me, notations and ways to represent date and time
There’s something called metric time
Resources
Date, Time and Timezone
Meta
data
: Doesn’t have a time component but what actual point-in-time it is really is determined by the reader of the data(where they live)date/time
: Same as date. The correct time is determined by what timezone your location is assigned to.date/time
by itself doesn’t seem
What to go with?
point-in-time data | interop btwn systems | different systems ops | sortable | |
---|---|---|---|---|
unix timestamp | YES | YES | YES | YES |
date time w tz | YES + tz origin data | No, needs logic | YES | YES |
date time w/o tz | No, represent social time |
Which timezone to pick? (If you picked date time w tz
)
- If you just want
date
and don’t want time component, UTC+000 seems like a way to go. - If you need to know the original timezone of the event, then store it with the original timezone.
- Unless you have a reason to store something in a local timezone, UTC is the right choice, but no choice is perfect.
- If using pg, use:
date
time
timestamp {without|with} time zone
timestamp without time zone
essentially falls into UTC
- AVOID
time with timezone
More on unix timestamp (from some article)
- Common misconception is that Unix time can’t be used to represent dates before January 1st, 1970.
- It is timezone agnostoc works across timezones
- Unlike Unix timestamp, there is no such thing as a universal DateTime format. Each programming language or tool relies on its own internal logic and implementation details for this data type. For the purpose of this article, we’ll categorize DateTime as an embedded calendar-aware and timezone-aware module, capable of handling the complexity of modern time-keeping systems.
Resources
- ISO 8601: the better date format | Blog | Kirby Kevinson
- Designing a REST API: Unix time vs ISO-8601
- Time on Unix
- Time is an illusion, Unix time doubly so
- Ian Mallett - Reference: Time Standards Page
- Falsehoods programmers believe about time zones
- [-] Wesley Aptekar-Cassels | Timezone Bullshit
- [-] Storing UTC is not a silver bullet (2019) | Lobsters
- You might as well timestamp it |> Changelog
- You (probably) don’t need DateTime · Scorpil