xref: /PHP-8.4/ext/date/tests/009.phpt (revision 29f98e74)
1--TEST--
2strftime() and gmstrftime() tests
3--SKIPIF--
4<?php
5if (substr(PHP_OS, 0, 3) == 'WIN') die('skip posix only test.');
6?>
7--FILE--
8<?php
9date_default_timezone_set('Asia/Jerusalem');
10
11$t = mktime(0,0,0, 6, 27, 2006);
12
13var_dump(strftime(""));
14var_dump(strftime("%a %A %b %B %c %C %d %D %e %g %G %h %H %I %j %m %M %n %p %r %R %S %t %T %u %U %V %W %w %x %X %y %Y %Z %z %%", $t));
15var_dump(strftime("%%q %%a", $t));
16var_dump(strftime("blah", $t));
17
18var_dump(gmstrftime(""));
19var_dump(gmstrftime("%a %A %b %B %c %C %d %D %e %g %G %h %H %I %j %m %M %n %p %r %R %S %t %T %u %U %V %W %w %x %X %y %Y %Z %z %%", $t));
20var_dump(gmstrftime("%%q %%a", $t));
21var_dump(gmstrftime("blah", $t));
22
23echo "Done\n";
24?>
25--EXPECTF--
26Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
27bool(false)
28
29Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
30string(%d) "Tue Tuesday Jun June Tue Jun 27 00:00:00 2006 %s
31%s %"
32
33Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
34string(5) "%q %a"
35
36Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
37string(4) "blah"
38
39Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
40bool(false)
41
42Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
43string(%d) "Mon Monday Jun June Mon Jun 26 21:00:00 2006 %s
44%s %"
45
46Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
47string(5) "%q %a"
48
49Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
50string(4) "blah"
51Done
52