Mailinglisten-Archive |
* Stefan Hamann wrote:
> erhalte ich die Kalenderwoche per strftime("%V", timestamp) nur bei
> PHP als Modul konfiguriert? Oder warum wird mir auf meiner
> Windowstestumgebung nichts wiedergegeben?
Die user annotated notes des Handbuchs sind immer eine Lektüre
wert:
| Windows users cannot use the %V specifier for strftime as it is not
| implemented in the OS.
| Following is a possible workaround to get the ISO weeknumber:
|
| function ISOWeek($y, $m, $d)
| {
| $week=strftime("%W", mktime(0, 0, 0, $m, $d, $y));
| $dow0101=getdate(mktime(0, 0, 0, 1, 1, $y));
| if ($dow0101["wday"]>1 &&
| $dow0101["wday"]<5)
| $week++;
| elseif ($week==0)
| $week=53;
| return(substr("00" . $week, -2));
| }
http://www.php.net/manual/en/function.strftime.php
--
Verbindlicher, professioneller PHP Support: wir helfen Ihnen
wenn es brennt, schnell und unkompliziert.
Weitere Informationen & Preise: team_(at)_thinkphp.de * 0700-THINKPHP
php::bar PHP Wiki - Listenarchive