Mailinglisten-Archive |
Aloha,
> ----------
> Von: Markus Bellenberg[SMTP:Bellenberg_(at)_kawo2.rwth-aachen.de]
>
> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
>
> man beachte das nun in $year eine 100 steht (Jahr seit 1900)
> was ziemlich sch.. aussieht
>
Ich stimm dir zu dass das SHIT aussieht. Es ist fast
so bloed wie 2-Stellige Jahreszahlen. Aber wie ich
gehoert habe, ist es posix-konform.
Aus der Perl-Func:
---------<schnipp>---------
localtime EXPR
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);
All array elements are numeric, and come straight out of a struct
tm. In particular this means that $mon has the range 0..11 and $wday has the
range 0..6 with sunday as day 0. Also, $year is the number of years since
1900, that is, $year is 123 in year 2023.
---------</schnipp>---------
Aus einer anderen Mailingliste:
---------<schnipp>---------
Wie gesagt dies ist KEIN Y2K Problem, sondern nach POSIX.
Aus time.h
struct tm {
int tm_sec; /* seconds after the minute [0-60] */
int tm_min; /* minutes after the hour [0-59] */
int tm_hour; /* hours since midnight [0-23] */
int tm_mday; /* day of the month [1-31] */
int tm_mon; /* months since January [0-11] */
int tm_year; /* years since 1900 */ <=== Hier
wie man sieht Jahre seit 1900
int tm_wday; /* days since Sunday [0-6] */
int tm_yday; /* days since January 1 [0-365] */
int tm_isdst; /* Daylight Savings Time flag */
long tm_gmtoff; /* offset from CUT in seconds */
char *tm_zone; /* timezone abbreviation */
};
Das Problem ist, viele haben angenommen, es handle sich dabei um Jahre
in 2 Stellen also nach 99 kommt 00
aber es sind ja schliesslich 100 Jahre seit 1900 ..
---------</schnipp>---------
Ich kann nur jedem empfehlen, bevor man eine
Funktion benutzt, die doku dazu zu lesen :-)
Grüße, Mathias
---
*** Abmelden von dieser Mailingliste funktioniert per E-Mail
*** an mysql-de-request_(at)_lists.4t2.com mit Betreff/Subject: unsubscribe
php::bar PHP Wiki - Listenarchive