Re:PostgreSQL's Missing DateDiff Function
by cedricd on Tuesday December 21, 2021 @05:52PM
(#29643079)
Yep. That's exactly why this function isn't trivial to write. Boundaries are not obvious and native pg functions (insofar as I'm aware of them) don't do these kinds of diffs.
Semantically the code has to diff days (for example) but be aware that you crossed a year boundary (or any other).
Semantically the code has to diff days (for example) but be aware that you crossed a year boundary (or any other).