On my modern 64bit Mac, the date 1901-12-14 is the earliest accepted by the following command:
date -ju -f "%F" "1901-12-14" "+%s"
I checked the source for the macOS date
command here (Apple Open Source) and it is a failed mktime
call that gives date: nonexistent time
error for earlier dates.
I've looked over the source for mktime
here (Apple Open Source) and I think that its a integer representation issue, but I'm not sure.
How can I find or compute the accepted range of dates of the date
command (really of mktime
)?
And if I wanted to get the Unix time for a date that can't be represented by mktime
internals, what other libraries or functions can handle earlier dates?