1--TEST-- 2Test DateTimeZone::getOffset() function : basic functionality 3--FILE-- 4<?php 5/* Prototype : int DateTimeZone::getOffset ( DateTime $datetime ) 6 * Description: Returns the timezone offset from GMT 7 * Source code: ext/date/php_date.c 8 * Alias to functions: timezone_offset_get() 9 */ 10 11echo "*** Testing DateTimeZone::getOffset() : basic functionality ***\n"; 12 13//Set the default time zone 14date_default_timezone_set("GMT"); 15 16$tz1 = new DateTimeZone("Europe/London"); 17$date = new DateTime("GMT"); 18var_dump( $tz1->getOffset($date) ); 19 20$tz2 = new DateTimeZone("America/New_York"); 21var_dump( $tz2->getOffset($date) ); 22 23$tz3 = new DateTimeZone("America/Los_Angeles"); 24var_dump( $tz3->getOffset($date) ); 25 26?> 27===DONE=== 28--EXPECTF-- 29*** Testing DateTimeZone::getOffset() : basic functionality *** 30%rint\(0\)|int\(3600\)%r 31%rint\(-18000\)|int\(-14400\)%r 32%rint\(-28800\)|int\(-25200\)%r 33===DONE=== 34