1--TEST-- 2strftime() and gmstrftime() tests 3--SKIPIF-- 4<?php 5if (substr(PHP_OS, 0, 3) != 'WIN') die('skip only windows test.'); 6if (!function_exists('strftime')) die("skip, strftime not available"); 7if (false === setlocale(LC_TIME, "en-us")) die("skip, couldn't set the locale to en-us"); 8?> 9--FILE-- 10<?php 11date_default_timezone_set('Asia/Jerusalem'); 12 13$loc = setlocale(LC_TIME, "0"); 14setlocale(LC_TIME, "en-us"); 15 16$t = mktime(0,0,0, 6, 27, 2006); 17 18var_dump(strftime()); 19 20var_dump(strftime("")); 21 22var_dump(strftime("%a %A %b %B %c %d %H %I %j %m %M %p %S %U %W %w %x %X %y %Y %Z %z %%", $t)); 23 24var_dump(strftime("%%q %%a", $t)); 25 26var_dump(strftime("blah", $t)); 27 28var_dump(gmstrftime()); 29 30var_dump(gmstrftime("")); 31 32var_dump(gmstrftime("%a %A %b %B %c %d %H %I %j %m %M %p %S %U %W %w %x %X %y %Y %Z %z %%", $t)); 33 34var_dump(gmstrftime("%%q %%a", $t)); 35 36var_dump(gmstrftime("blah", $t)); 37 38echo "Done\n"; 39 40setlocale(LC_TIME, $loc); 41?> 42--EXPECTF-- 43Warning: strftime() expects at least 1 parameter, 0 given in %s on line %d 44bool(false) 45bool(false) 46string(%d) "Tue Tuesday Jun June 6/27/2006 12:00:00 AM 27 00 12 178 06 00 AM 00 26 26 2 6/27/2006 12:00:00 AM 06 2006 %s" 47string(5) "%q %a" 48string(4) "blah" 49 50Warning: gmstrftime() expects at least 1 parameter, 0 given in %s on line %d 51bool(false) 52bool(false) 53string(%d) "Mon Monday Jun June 6/26/2006 9:00:00 PM 26 21 09 177 06 00 PM 00 26 26 1 6/26/2006 9:00:00 PM 06 2006 %s" 54string(5) "%q %a" 55string(4) "blah" 56Done 57