Issue
I am trying to get the offset hours from UTC, given a summer date. My system time is set to America/Los_Angeles.
I have the following:
require_once("Date.php");
$dateTZ = new Date_TimeZone('America/Los_Angeles');
echo $dateTZ->getOffset(new Date('2009-07-01 12:00:00'))/1000/60/60;
This prints '-8'; shouldn't it show '-7'?
echo $dateTZ->getOffset(new Date())/1000/60/60;
also prints '-8'.
What am I doing wrong?
Solution
Does Date::inDaylightTime() help you? Date::getTZOffset claims to include daylight savings offset.
Answered By - cletus Answer Checked By - Cary Denson (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.