On 9.1.2013 12:22, Arno Kuhl wrote:
Both %U and %W seem to return what you want, using strftime.  I'd guess that
date would also have flags for these.

No. That's one thing I've wondered sometimes.

According to documentation:

strftime has:
Week    ---     ---
%U Week number of the given year, starting with the first Sunday as the first week 13 (for the 13th full week of the year) %V ISO-8601:1988 week number of the given year, starting with the first week of the year with at least 4 weekdays, with Monday being the start of the week 01 through 53 (where 53 accounts for an overlapping week) %W A numeric representation of the week of the year, starting with the first Monday as the first week 46 (for the 46th week of the year beginning with a Monday)

date has:
Week    ---     ---
W ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0) Example: 42 (the 42nd week in the year)

Also then ISO-8601 week number is kind of mixed, or is older iso
week something different than in 1988 version of the standard=
By description they both %W and W do the same, but other one
is ISO-8601 and in strftime ISO-8601:1988 is %V which is different.

Or is it so that strftime %V is same as date's W, both are really the
iso week's but description for date forgets to mention about that
"at least 4 weekdays".

So at least someone could fix the documentation to be exact to
one don't have to guess or rtfs.



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

Reply via email to