Re: PHP 4.0 Bug #7640 Updated: problem with weeknumbers
| From: | Rasmus Lerdorf | Date: | Sun, 05 Nov 2000 06:24:40 +0000 |
| Subject: | Re: PHP 4.0 Bug #7640 Updated: problem with weeknumbers | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-37154@lists.php.net to get a copy of this message | ||
> > ID: 7640
> > Updated by: rasmus
> > Reported By: jesper@barra.se
> > Status: Closed
> > Bug Type: Date/time related
> > Assigned To:
> > Comments:
> >
> > That is expected behaviour. Please read the manual:
> > http://www.php.net/manual/function.strftime.php
> >
> > %V - The ISO 8601:1988 week number of the current year as a decimal number, range 01 to
> > 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as
> > the first day of the week.
> >
> > Previous Comments:
> > ---------------------------------------------------------------------------
> >
> > [2000-11-04 17:59:07] jesper@barra.se
> > print strftime("%V",mktime(0,0,0,12,31,1999));
> > # prints weeknumber 52
> > print strftime("%V",mktime(0,0,0,01,01,2000));
> > # prints weeknumber 53
> >
> >
> > ---------------------------------------------------------------------------
> >
> >
> > Full Bug description available at:
> > http://bugs.php.net/?id=7640
> >
>
> I thought so too, then I checked, and the first is a Friday, and the
> second is a Saturday. Inquiring minds want to know: why does the week
> count increment even though it's actually the same week?
Because your c library is broken on your platform. The above script on my
Linux box returns 52 and 52.
-Rasmus