Nicholas Lindley

Dates in MongoDB suck.

If we want to store a future local time, the Date type is insufficient since it’s an offset from the Unix epoch. This is fine for things that have already happened since they are frozen in time, but if we have scheduled something for a particular time on a particular day and the rules change for daylight saving time, we could end up an hour off.

We can store the local date as a string, object, offset, or custom binary representation, but now we’re making up our own types that impact querying, sorting, and developer ergonomics.