Returns the time zone offset relative to GMT:
<?php$tz=timezone_open("Asia/Taipei");$dateTimeOslo=date_create("now",timezone_open("Europe/Oslo"));echo timezone_offset_get($tz,$dateTimeOslo);?>timezone_offset_get() returns the time zone offset relative to GMT.
timezone_offset_get (object,datetime);
parameter | describe |
---|---|
object | Required. Specifies a DateTimeZone object returned by timezone_open(). |
datetime | Required. Specifies the date/time at which the offset needs to be calculated. |
Return value: | Returns the time zone offset in seconds on success, or FALSE on failure. |
---|---|
PHP version: | 5.2+ |