DateTimes in Relational Databases
(This article's title comic is from Randall Munroe, creator of the XKCD comic, and licensed under CC BY-NC 2.5, you can find the original here).
TL;DR? Check this resource to read-up why I am in the "impossible to know camp"
How dare you to ask me what the difference between two points in time is? You didn't yet provide the necessary information to even consider how to answer it:
Recommended by LinkedIn
Save for the last two, you can read up on this and other quirks on handling DateTime in Richard T. Snodgrass's extremely excellent, “Developing Time-Oriented Database Applications in SQL” (Morgan Kaufmann, 2000 – Yes, it’s old, yes, it is out of print, but yes, it’s still extraordinarily good! You can download it from Richard’s homepage). This is by the way also an excellent treatment of how to handle historization in relational databases!
https://youtu.be/-5wpm-gesOY?si=DDbxLZbegSS_psQP 🙌
Time is a fiction, don't rely on it :)
You would not believe HOW MUCH TIME (sic!) I have already spent to explain, why e.g. IoT backend data designs should never rely on timestamps, but simple monotonous hardware clocks, aka event counters, if the exact order of events is of some relevance. Using "timestamp without timezone" in PostgreSQL is a harmless looking deathtrap, unless you know exactly what you are doing. Another great read about time is the seminal paper on Spanner: https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://research.google.com/archive/spanner-osdi2012.pdf&ved=2ahUKEwiImOPb1pGDAxX9hP0HHW1OCGkQFnoECBEQAQ&usg=AOvVaw0jTMltcXSUju43NRB29vPi
Aaah, time... https://gist.github.com/timvisee/fcda9bbdff88d45cc9061606b4b923ca