PageRenderTime 46ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/2.0/Tests/DateTime/strftime.php

#
PHP | 20 lines | 18 code | 2 blank | 0 comment | 3 complexity | e2a3902edcce4aa16a437fe394e4482b MD5 | raw file
Possible License(s): CPL-1.0, GPL-2.0, CC-BY-SA-3.0, MPL-2.0-no-copyleft-exception, Apache-2.0
  1. [expect php]
  2. [file]
  3. <?
  4. date_default_timezone_set("Europe/Prague");
  5. $year = 2000;
  6. $first_day = mktime(0,0,0,1,1,$year);
  7. $a = getdate($first_day);
  8. $i = 0;
  9. for($day = -$a["wday"]; $day<366*5; $day++, $i++)
  10. {
  11. $d = mktime(0,0,0,1,$day,$year);
  12. if ($i % 7 == 0)
  13. {
  14. echo "\n",strftime("%U/%W ",$d);
  15. }
  16. echo strftime("%d ",$d);
  17. }
  18. ?>