Annotation of embedaddon/php/ext/date/tests/DateTime_setTimezone_basic1.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test DateTime::setTimezone() function : basic functionality
3: --FILE--
4: <?php
5: /* Prototype : public DateTime DateTime::setTimezone ( DateTimeZone $timezone )
6: * Description: Sets the time zone for the DateTime object
7: * Source code: ext/date/php_date.c
8: * Alias to functions: date_timezone_set
9: */
10:
11: echo "*** Testing DateTime::setTimezone() : basic functionality ***\n";
12:
13: //Set the default time zone
14: date_default_timezone_set("Europe/London");
15:
16: $datetime = new DateTime("2009-01-30 17:57:32");
17: echo "Default timezone: " . date_timezone_get($datetime)->getName() . "\n";
18:
19: $la_time = new DateTimezone("America/Los_Angeles");
20: $datetime->setTimezone($la_time);
21: echo "New timezone: " . date_timezone_get($datetime)->getName() . "\n";
22:
23: ?>
24: ===DONE===
25: --EXPECTF--
26: *** Testing DateTime::setTimezone() : basic functionality ***
27: Default timezone: Europe/London
28: New timezone: America/Los_Angeles
29: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>