date_offset_get

(PHP 5 >= 5.2.0, PHP 7)

date_offset_get별칭: DateTime::getOffset()

설명

이 함수는 다음 함수의 별칭입니다: DateTime::getOffset()

add a note add a note

User Contributed Notes 1 note

up
0
Kae Cyphet
14 years ago
The following gets the timezone of the server including daylight savings time changes.

<?php
$seconds
= date_offset_get(new DateTime);
print
$seconds / 3600;
// returns pos/neg decimal (eg. -7 if in PST and DST is active.)
// remember there are time zones with 30 and 45 min offsets
// http://en.wikipedia.org/wiki/Time_zone
?>
To Top