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