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

PHP date_offset_get() Function

PHP Date/Time PHP Date/Time Reference

Example

Return the timezone offset for Oslo (in Norway, Europe) in seconds from UTC, winter and summer:

<?php
$winter=date_create("2013-12-31",timezone_open("Europe/Oslo"));
$summer=date_create("2013-06-30",timezone_open("Europe/Oslo"));

echo date_offset_get($winter) . " seconds.<br>";
echo date_offset_get($summer) . " seconds.";
?>

Run example »

Definition and Usage

The date_offset_get() function returns the timezone offset.


Syntax

date_offset_get(object);

Parameter Description
object Required. Specifies a DateTime object returned by date_create()

Technical Details

Return Value: Returns the timezone in seconds from UTC 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