Friday, February 12, 2010

Programmer - Weird behavior calculating timezone difference

I can't explain this. I have the following:



     $time += $res['timezone']; (The array equates to -5*3600 (EST))
return gmstrftime('%c',$time);


When I echo $res['timezone'], I get "-5*3600" which is correct. When I put the array value in front of the time variable, I get the incorrect time. If I comment out the array value and replace it with -5*3600, I get the correct result. Why??

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails