1--TEST-- 2Test DateTime::getOffset() function : basic functionality 3--FILE-- 4<?php 5/* Prototype : public int DateTime::getOffset ( void ) 6 * Description: Returns the daylight saving time offset 7 * Source code: ext/date/php_date.c 8 * Alias to functions: date_offset_get 9 */ 10 11//Set the default time zone 12date_default_timezone_set('Europe/London'); 13 14echo "*** Testing DateTime::getOffset() : basic functionality ***\n"; 15 16$winter = new DateTime('2008-12-25 14:25:41'); 17$summer = new DateTime('2008-07-02 14:25:41'); 18 19echo "Winter offset: " . $winter->getOffset() / 3600 . " hours\n"; 20echo "Summer offset: " . $summer->getOffset() / 3600 . " hours\n"; 21 22?> 23===DONE=== 24--EXPECT-- 25*** Testing DateTime::getOffset() : basic functionality *** 26Winter offset: 0 hours 27Summer offset: 1 hours 28===DONE=== 29