xref: /PHP-7.4/ext/date/tests/009_win32.phpt (revision 3a857852)
1--TEST--
2strftime() and gmstrftime() tests
3--SKIPIF--
4<?php
5if (substr(PHP_OS, 0, 3) != 'WIN') die('skip only windows test.');
6if (false === setlocale(LC_TIME, "en-us")) die("skip, couldn't set the locale to en-us");
7?>
8--FILE--
9<?php
10date_default_timezone_set('Asia/Jerusalem');
11
12$loc = setlocale(LC_TIME, "0");
13setlocale(LC_TIME, "en-us");
14
15$t = mktime(0,0,0, 6, 27, 2006);
16
17var_dump(strftime());
18
19var_dump(strftime(""));
20
21var_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));
22
23var_dump(strftime("%%q %%a", $t));
24
25var_dump(strftime("blah", $t));
26
27var_dump(gmstrftime());
28
29var_dump(gmstrftime(""));
30
31var_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));
32
33var_dump(gmstrftime("%%q %%a", $t));
34
35var_dump(gmstrftime("blah", $t));
36
37echo "Done\n";
38
39setlocale(LC_TIME, $loc);
40?>
41--EXPECTF--
42Warning: strftime() expects at least 1 parameter, 0 given in %s on line %d
43bool(false)
44bool(false)
45string(%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"
46string(5) "%q %a"
47string(4) "blah"
48
49Warning: gmstrftime() expects at least 1 parameter, 0 given in %s on line %d
50bool(false)
51bool(false)
52string(%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"
53string(5) "%q %a"
54string(4) "blah"
55Done
56