php-general Digest 8 Jan 2013 20:44:07 -0000 Issue 8091
Topics (messages 320054 through 320054):
Some date() oddities
320054 by: Arno Kuhl
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
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
I found some warnings regarding ISO8601 for this in the user notes for the
date() function in the PHP manual but couldn't see how this is managed in
code, does anyone know of a workaround for this?
Cheers
Arno
--- End Message ---