xref: /PHP-8.3/ext/date/tests/004.phpt (revision f8d79582)
1--TEST--
2date() format params
3--FILE--
4<?php
5
6date_default_timezone_set("UTC");
7$tz = array("UTC", "Asia/Jerusalem", "America/Chicago", "Europe/London");
8$t = mktime(0, 0, 0, 6, 27, 2006);
9
10foreach ($tz as $zone) {
11    date_default_timezone_set($zone);
12
13    var_dump(date("w", $t));
14    var_dump(date("z", $t));
15    var_dump(date("n", $t));
16    var_dump(date("t", $t));
17    var_dump(date("L", $t));
18    var_dump(date("a", $t));
19    var_dump(date("B", $t));
20    var_dump(date("g", $t));
21    var_dump(date("G", $t));
22    var_dump(date("Z", $t));
23    var_dump(date("U", $t));
24}
25
26echo "Done\n";
27?>
28--EXPECT--
29string(1) "2"
30string(3) "177"
31string(1) "6"
32string(2) "30"
33string(1) "0"
34string(2) "am"
35string(3) "041"
36string(2) "12"
37string(1) "0"
38string(1) "0"
39string(10) "1151366400"
40string(1) "2"
41string(3) "177"
42string(1) "6"
43string(2) "30"
44string(1) "0"
45string(2) "am"
46string(3) "041"
47string(1) "3"
48string(1) "3"
49string(5) "10800"
50string(10) "1151366400"
51string(1) "1"
52string(3) "176"
53string(1) "6"
54string(2) "30"
55string(1) "0"
56string(2) "pm"
57string(3) "041"
58string(1) "7"
59string(2) "19"
60string(6) "-18000"
61string(10) "1151366400"
62string(1) "2"
63string(3) "177"
64string(1) "6"
65string(2) "30"
66string(1) "0"
67string(2) "am"
68string(3) "041"
69string(1) "1"
70string(1) "1"
71string(4) "3600"
72string(10) "1151366400"
73Done
74