On Tue, Jan 8, 2013 at 3:43 PM, Arno Kuhl <a...@dotcontent.net> wrote:
> I've bumped into an odd result with the date() function that I can't make
> sense of.
>
> Starting with a unix timestamp for 31 December 2012 13:12:12 (which is
> 1356952332) I calculate a week number:
>
> $ux_date = 1356952332;
>
> $weeknumber = date("W", $ux_date);   // returns 01 instead of 52

    Because, technically, 31 December was the second date of the
*fifty-third* week of 2012.  However, because the majority of the week
falls in 2013, it's rounded-in with that.

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to