Michael Schröpl: (ZUR INFO) angeblicher Y2K Bug in Perl ist keiner

Beitrag lesen

Converts a time as returned by the time function to a 9-element array with the
time analyzed for the local time zone. Typically used as follows:

#  0    1    2     3     4    5     6     7     8
         ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);

[..] Also, $year is the number of years since 1900, that is, $year is 123 in year 2023,
and notsimply the last two digits of the year."

Absolute Zustimmung.

Denn jeder, der ein solches Datum in Perl weiterverarbeiten will, muß ja auch lernen, daß die Monate ($mon) im Intervall [0..11] geliefert werden und nicht etwa im Intervall [1..12]. Also muß man den Monat um 1 erhöhen - wenn man das vergißt, ist es auch kein bug von Perl, sondern einer des Programmierers.