strtotime weeknummer niet correct

Status
Niet open voor verdere reacties.

Frenske123

Terugkerende gebruiker
Lid geworden
2 jul 2007
Berichten
1.267
Hoi,

Hier wordt het weeknummer en datum geprint:

PHP:
echo strftime("wk-%W %d-januari", strtotime("first Monday of January 2015"));echo "<br>";

uitkomst : wk-01 05-januari.
Zou moeten zijn wk-02 05-januari week 2

Iemand een idee?
 
Of het week 1 of 2 is hangt ad van welke kalender je aanhangt: http://us3.php.net/manual/en/function.strftime.php

%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)
 
Bedankt voor antwoord PgVincent , die had ik intussen ook gevonden en met %V kunnen oplossen.
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan