schockierender weise kann Date::Parse
use Date::Parse qw( str2time);
print str2time("1958-01-01 12:00:00")
nicht parsen, obwohl Date::Parse Time::Local als backend verwendet und dieses kann sehrwohl mit diesem datum umgehen. nach 2 stunden debugging bin ich dann draufgekommen, dass str2time timelocal (=funktion von Time::Local) mit einem 2-stelligem Jahrescode aufruft:
timelocal(00, 00, 12, 1, 0, 58);
aber was macht Time::Local, habs fast nicht geglaubt beim lesen, eh schlau, aber eben auch doof!!
Years in the range 0..99 are interpreted as shorthand for years in the rolling "current century," defined as 50 years on either side of the current year. Thus, today, in 1999, 0 would refer to 2000, and 45 to 2045, but 55 would refer to 1955. Twenty years from now, 55 would instead refer to 2055. This is messy, but matches the way people currently think about two digit dates. Whenever possible, use an absolute four digit year instead.
der hack, dass es wieder funktioniert ist leicht (einfach 1900 beim aufruf von timelocal hinzufuegen), aber ich will den hack nicht auf allen rechnern einbaun. schade ich hab das modul sehr gemocht, da es so einfach zu verwenden war, extrem schnell ist, und bis jetzt nie probleme gemacht hat. werd wohl auf DateTime bzw. DateTime::Format::HTTP umsteigen.
2 Kommentar(e):
Neuen Kommentar schreiben: