Mailinglisten-Archive |
Hallo,
Hannes Streicher wrote:
>
> >%W - week number of the current year as a decimal number,
> > starting with the first Monday as the first day of
> > the first week
> >
> aber auch die oben genannte function(functionsparameter) liefert nicht die
> richtige woche, wie schon geschrieben :
>
> 1997 und 1998 liefert die php function die falschen werte.
print strftime("%W", mktime (0,0,0,1,1,1997));
print strftime("%W", mktime (0,0,0,1,1,1998));
Beides mal: 0 == FALSE. Passt doch.
Auch Dir als Bayer sollte es einleuchten, dass die
Original-Computer-Kalenterwoche so einen Firlefanz wie die menschliche
kalendarische Kalenderwoche nicht berücksichtigen kann ;-) Computer
sind noch nie sehr
genau gewesen und kommen mit Datumsangaben schon grundsätzlich nicht
klar, siehe Y2K (z.B. 29. Februar 2000 = 400-Jahresregel vs.
100-Jahresregel).
Aber wenn Du unbedingt
Week number of year with Monday as first day of the week
(1...53). If the week containing January 1 has four or more days
in the new year, then it is considered week 1; otherwise, it is
week 53 of the previous year, and the next week is week 1. (See the
ISO 8601: 1988 standard.)
berücksichtigen willst, dann gibt es hier das, bitte selber testen:
http://px.sklar.com/section.html?section_id=8
Mit freundlichen Grüßen,
Oliver Kummerow
email: naklar_(at)_altavista.net
php::bar PHP Wiki - Listenarchive