Thread ungültige Datumseingaben (16 answers)
Opened by jan10001 at 2005-03-14 01:51

pKai
 2005-03-14 22:39
#52637 #52637
User since
2005-02-18
357 Artikel
BenutzerIn
[default_avatar]
[quote=jan10001,14.Mar..2005, 18:37]@pKai
Damit es läuft mußte noch "-1900" rein, aber jetzt läufts. :)[/quote]
Wieso?
perldoc Time::Local
Quote
Strictly speaking, the year should also be specified in a form
consistent with localtime(), i.e. the offset from 1900. In order to make
the interpretation of the year easier for humans, however, who are more
accustomed to seeing years as two-digit or four-digit values, the
following conventions are followed:

* Years greater than 999 are interpreted as being the actual year,
rather than the offset from 1900. Thus, 1963 would indicate the year
Martin Luther King won the Nobel prize, not the year 2863.

...
BUGS
The whole scheme for interpreting two-digit years can be considered a
bug.
:D

Sollte allerdings fast nie ein Unterschied machen. Einziges Bsp. was mir spontan einfiel:
[29, 2, 1900], (kein Schaltjahr) was bei dir als (0,0,0,29,1,0) eingekippt wird, wird von timelocal (siehe perldoc Time::Local; im Teil der oben nicht zitiert wurde "...") als 29.2.2000 angesehen. Und dies war bekanntlich ein Schaltjahr.\n\n

<!--EDIT|pKai|1110834526-->
I sense a soul in search of answers.

View full thread ungültige Datumseingaben