1--TEST--
2Test date_timezone_set() function : basic functionality
3--FILE--
4<?php
5/* Prototype  : DateTime date_timezone_set  ( DateTime $object  , DateTimeZone $timezone  )
6 * Description: Sets the time zone for the DateTime object
7 * Source code: ext/date/php_date.c
8 * Alias to functions: DateTime::setTimezone
9 */
10
11echo "*** Testing date_timezone_set() : basic functionality ***\n";
12
13//Set the default time zone
14date_default_timezone_set("Europe/London");
15
16$datetime = date_create("2009-01-30 17:57:32");
17$tz = date_timezone_get($datetime);
18echo "Default timezone: " . timezone_name_get($tz) . "\n";
19
20$datetime = date_create("2009-01-30 22:57:32");
21$la_time = timezone_open("America/Los_Angeles");
22
23date_timezone_set($datetime, $la_time);
24$tz = date_timezone_get($datetime);
25echo "New timezone: " . timezone_name_get($tz) . "\n";
26
27?>
28===DONE===
29--EXPECTF--
30*** Testing date_timezone_set() : basic functionality ***
31Default timezone: Europe/London
32New timezone: America/Los_Angeles
33===DONE===
34