fix timezone offset manually
This commit is contained in:
parent
f571b0d1ec
commit
c15d6becfd
|
@ -244,11 +244,17 @@
|
||||||
|
|
||||||
/* [3] Convert to UTC (+0)
|
/* [3] Convert to UTC (+0)
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
/* (1) Get local timestamp */
|
/* (1) Get local timezone */
|
||||||
$ts = strtotime("${day} $hour:$min:00");
|
$tz = date_default_timezone_get();
|
||||||
|
|
||||||
/* (2) Return UTC date */
|
/* (2) Get timezone offset */
|
||||||
return gmdate("Ymd\THis", $ts);
|
$tz_offset = get_timezone_offset($tz);
|
||||||
|
|
||||||
|
/* (3) Get GMT (UTC+0) timestamp */
|
||||||
|
$ts = strtotime("${day} $hour:$min:00") + $tz_offset;
|
||||||
|
|
||||||
|
/* (4) Return GMT date */
|
||||||
|
return date("Ymd\THis", $ts);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue