Annotation of embedaddon/php/ext/date/tests/date_timezone_get_basic1.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test date_timezone_get() function : basic functionality
3: --FILE--
4: <?php
5: /* Prototype : DateTimeZone date_timezone_get ( DateTime $object )
6: * Description: Return time zone relative to given DateTime
7: * Source code: ext/date/php_date.c
8: * Alias to functions: DateTime::setTimezone
9: */
10:
11: echo "*** Testing date_timezone_get() : basic functionality ***\n";
12:
13: date_default_timezone_set("Europe/London");
14: $object = date_create("2009-01-30 17:57:32");
15: $tz = date_timezone_get($object);
16: var_dump( timezone_name_get($tz) );
17:
18: date_default_timezone_set("America/New_York");
19: $object = date_create("2009-01-30 17:57:32");
20: $tz = date_timezone_get($object);
21: var_dump( timezone_name_get($tz) );
22:
23: $la_time = timezone_open("America/Los_Angeles");
24: date_timezone_set($object, $la_time);
25: $tz = date_timezone_get($object);
26: var_dump( timezone_name_get($tz) );
27:
28: ?>
29: ===DONE===
30: --EXPECTF--
31: *** Testing date_timezone_get() : basic functionality ***
32: string(13) "Europe/London"
33: string(16) "America/New_York"
34: string(19) "America/Los_Angeles"
35: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>