PHP timezone_offset_get() function
Example
Returns the timezone offset relative to GMT:
<?php $tz=timezone_open("Asia/Taipei"); $dateTimeNY=date_create("now",timezone_open("America/New_York")); echo timezone_offset_get($tz,$dateTimeNY); ?>
Definition and Usage
timezone_offset_get() returns the timezone offset relative to GMT.
Syntax
timezone_offset_get(object,datetime);
Parameter | Description |
---|---|
object | Required. Specifies by timezone_open() The returned DateTimeZone object. |
datetime | Required. Specifies the date/time for which the offset needs to be calculated. |
Technical Details
Return Value: | If successful, returns the timezone offset in seconds, otherwise returns FALSE. |
---|---|
PHP Version: | 5.2+ |