文字

date_offset_get

(PHP 5 >= 5.2.0, PHP 7)

date_offset_get别名 DateTime::getOffset()

说明

此函数是该函数的别名: DateTime::getOffset()

用户评论:

[#1] Kae Cyphet [2010-10-11 14:43:09]

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
?>

上一篇: 下一篇: