Retrieve the timezone offset from GMT.
<?php $tz=timezone_open(“Asia/Taipei”); $dateTimeOslo=date_create(“now”,timezone_open(“Europe/Oslo”)); echo timezone_offset_get($tz,$dateTimeOslo); ?> |
The timezone_offset_get() function returns the timezone offset from GMT.
timezone_offset_get(object, datetime) |
Parameter |
Description |
object |
Required. Specifies a DateTimeZone object obtained from timezone_open(). |
datetime |
Required. Specifies the date/time for computing the offset. |
Return Value: |
Returns the timezone offset in seconds on success, or FALSE on failure. |
PHP Version: |
5.2+ |