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