Turns out there's lots of epochs, and the Unix epoch doesn't have any "rationale" according to Wikipedia: https://en.wikipedia.org/wiki/Epoch_(computing)#Notable_epoc...
For example, Ingenuity helicopter counts from 2000.
Turns out there's lots of epochs, and the Unix epoch doesn't have any "rationale" according to Wikipedia: https://en.wikipedia.org/wiki/Epoch_(computing)#Notable_epoc...
For example, Ingenuity helicopter counts from 2000.
It's somewhat arbitrary, but by making it a signed integer, Dennis Ritchie figured it was good enough to represent dates spanning his entire life time. He probably thought Unix's life time would be significantly shorter rather than outliving him.
https://www.tuhs.org/cgi-bin/utree.pl?file=V3/man/man2/time....
vs
https://www.tuhs.org/cgi-bin/utree.pl?file=V4/man/man2/time....
EDIT: note that back then, it was a signed integer. Turns out that people wanted to be able to represent dates from before 1970 so we lost one bit.
> note that back then, it was a signed integer.
Still and always is. We'd be having a 2106 problem instead of 2038 if it was unsigned 32-bit.
When Excel came around, it needed to be compatible with 1-2-3, so it used the same date format, and to be compatible it considers 1900 to be a leap year.
https://support.microsoft.com/en-us/office/date-systems-in-e...
The original Excel was for the Macintosh and had the 1904 date system, and was later brought to Windows where the 1900 date system was used.
External declarations, as well as the tm structure definition, are
contained in the <time.h> include file. The tm structure includes at
least the following fields:
int tm_sec; /∗ seconds (0 - 60) ∗/
int tm_min; /∗ minutes (0 - 59) ∗/
int tm_hour; /∗ hours (0 - 23) ∗/
int tm_mday; /∗ day of month (1 - 31) ∗/
int tm_mon; /∗ month of year (0 - 11) ∗/
int tm_year; /∗ year - 1900 ∗/
int tm_wday; /∗ day of week (Sunday = 0) ∗/
int tm_yday; /∗ day of year (0 - 365) ∗/
int tm_isdst; /∗ is summer time in effect? ∗/
char ∗tm_zone; /∗ abbreviation of timezone name ∗/
long tm_gmtoff; /∗ offset from UTC in seconds ∗/
You'll note that tm_year is years since 1900.While working support at SGI in the late 90s, got a number of support tickets (there was a woman who worked for a government department (NASA?) who was very good at finding them in doing their y2k checks) about dates showing up as `20100`.