X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP timezone_offset_get() Function

PHP Date/Time PHP Date/Time Reference

Example

Return 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);
?>

Run example »

Definition and Usage

The timezone_offset_get() returns the timezone offset from GMT.


Syntax

timezone_offset_get(object,datetime);

Parameter Description
object Required. Specifies a DateTimeZone object returned by timezone_open()
datetime Required. Specifies a date/time to compute the offset from

Technical Details

Return Value: Returns the timezone offset in seconds on success. FALSE on failure
PHP Version: 5.2+


PHP Date/Time PHP Date/Time Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook