Re: Re: Is this a bug with date() ?
| From: | Hans Åhlin | Date: | Wed, 30 Jun 2010 23:40:23 +0000 |
| Subject: | Re: Re: Is this a bug with date() ? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-306581@lists.php.net to get a copy of this message | ||
A year can have 52 or 53 weeks and it can begin with week nr 1, 52 or 53
check this algorithm
http://www.threesides.se/blogg/2010/04/15/date-calculation-algorithm/
**********************************************
Hans Åhlin
Tel: +46761488019
icq: 275232967
http://www.kronan-net.com/
irc://irc.freenode.net:6667 - TheCoin
**********************************************
2010/6/30 Lester Caine <lester@lsces.co.uk>:
> Michael Alaimo wrote:
>>
>> I have found a bug report. This is the correct functionality.
>>
>> Mike
>>
>>> I understand that technically there are more than 52 weeks in a year.
>>> Well at least google says 1 year = 52.177457 weeks.
>>>
>>> So I run the command:
>>> php> echo date('W' , mktime(0, 0, 0, 1, 1, date('Y')));
>>> 53
>>>
>>> As you can see the result is 53.
>>>
>>> Any thoughts on this?
>
>
> http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/1016ca2b-7f43-2b10-8199-a78d1bcc49e9&overridelayout=true
> Covers it nicely ...
>
> --
> Lester Caine - G8HFL
> -----------------------------
> Contact - http://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - http://lsces.co.uk
> EnquirySolve - http://enquirysolve.com/
> Model Engineers Digital Workshop - http://medw.co.uk//
> Firebird - http://www.firebirdsql.org/index.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>