3 ms·
Perl counts from 1900, so the year 2000 was actually stored as 100. You'd get 2 digit years in the 1990s and suddenly 3 digit years after 2000. The solution was
by bluesmoon 4y ago
Perl counts from 1900, so the year 2000 was actually stored as 100. You'd get 2 digit years in the 1990s and suddenly 3 digit years after 2000. The solution was to arithmetically add 1900 to the year before rendering. Newer perl functions would handle that internally.
- shagie 4y agoThat's a direct translation of struct_tm from time.h. 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`.