xref: /PHP-5.6/ext/date/tests/014.phpt (revision fdb2709d)
1--TEST--
2timezone_offset_get() tests
3--FILE--
4<?php
5date_default_timezone_set('UTC');
6
7$dto = date_create("2006-12-12");
8var_dump($dto);
9
10$dtz = date_timezone_get($dto);
11var_dump($dtz);
12
13var_dump(timezone_offset_get());
14var_dump(timezone_offset_get($dtz, $dto));
15var_dump(timezone_offset_get($dto, $dtz));
16
17echo "Done\n";
18
19?>
20--EXPECTF--
21object(DateTime)#%d (3) {
22  ["date"]=>
23  string(26) "2006-12-12 00:00:00.000000"
24  ["timezone_type"]=>
25  int(3)
26  ["timezone"]=>
27  string(3) "UTC"
28}
29object(DateTimeZone)#%d (2) {
30  ["timezone_type"]=>
31  int(3)
32  ["timezone"]=>
33  string(3) "UTC"
34}
35
36Warning: timezone_offset_get() expects exactly 2 parameters, 0 given in %s on line %d
37bool(false)
38int(0)
39
40Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, object given in %s on line %d
41bool(false)
42Done
43