Hacker News new | ask | show | jobs
by pygy_ 1589 days ago
Type error.

A `date` is a time interval (from midnight to midnight in a given time zone). One could argue that `time` values in computer programs also cover a span, even if it is infinitesimally small for most purposes.

The correct operation to compare intervals of varying lengths is not equality, it is either containment or overlap.

1 comments

One could argue that a date is a region in spacetime. It starts at the dateline, spreads eastward, and ends at the dateline some 48 hours later. (Edit: 50 hours is closer to the truth. And one could quibble about the definition of “dateline”, as Samoa moved across it once.)

Interesting take from 1999: Erik Naggum: The Long, Painful History of Time

http://naggum.no/lugm-time.html