Get the timezone offset for Oslo (in Norway, Europe) in seconds from UTC in PHP

Description

The following code shows how to get the timezone offset for Oslo (in Norway, Europe) in seconds from UTC.

Example


/*from w ww .  j  a  v a 2s  .  c  om*/
<?php
    $winter=date_create("2014-12-31",timezone_open("Europe/Oslo"));
    $summer=date_create("2014-06-30",timezone_open("Europe/Oslo"));

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

The code above generates the following result.





















Home »
  PHP Tutorial »
    Data Types »




Array
Array Associative
Array Util
ArrayObject
Data Types
Date
Date Format
DateTime
Number
String
String Escape
String Filter
String HTML
String Type
Timezone