Retrieve the timezone offset for Oslo (Norway, Europe) in seconds from UTC, including both winter and summer times.
<?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.”; ?> |
The date_offset_get() function returns the timezone offset of a DateTime object.
date_offset_get(object) |
Parameter |
Description |
object |
Required. Specifies a DateTime object created by |
Return Value: |
Returns the timezone offset in seconds from UTC on success; FALSE on failure. |
PHP Version: |
5.2+ |