xref: /PHP-8.1/ext/date/tests/009_win32.phpt (revision 4b3615a3)
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--
38Deprecated: Function strftime() is deprecated in %s on line %d
39bool(false)
40
41Deprecated: Function strftime() is deprecated in %s on line %d
42string(%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"
43
44Deprecated: Function strftime() is deprecated in %s on line %d
45string(5) "%q %a"
46
47Deprecated: Function strftime() is deprecated in %s on line %d
48string(4) "blah"
49
50Deprecated: Function gmstrftime() is deprecated in %s on line %d
51bool(false)
52
53Deprecated: Function gmstrftime() is deprecated in %s on line %d
54string(%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"
55
56Deprecated: Function gmstrftime() is deprecated in %s on line %d
57string(5) "%q %a"
58
59Deprecated: Function gmstrftime() is deprecated in %s on line %d
60string(4) "blah"
61Done
62