xref: /PHP-8.0/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("%a %A %b %B %c %d %H %I %j %m %M %p %S %U %W %w %x %X %y %Y %Z %z %%", $t));
20
21var_dump(strftime("%%q %%a", $t));
22
23var_dump(strftime("blah", $t));
24
25var_dump(gmstrftime(""));
26
27var_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));
28
29var_dump(gmstrftime("%%q %%a", $t));
30
31var_dump(gmstrftime("blah", $t));
32
33echo "Done\n";
34
35setlocale(LC_TIME, $loc);
36?>
37--EXPECTF--
38bool(false)
39string(%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"
40string(5) "%q %a"
41string(4) "blah"
42bool(false)
43string(%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"
44string(5) "%q %a"
45string(4) "blah"
46Done
47