Binary Expressions

2006-7-28

Default Timezone in PHP, Not Working?

Filed under: — Adam @ 2:13 pm

Since I started using PHP 5.x.x I started to experience incorrect time reported back through PHP using for example date(). I checked phpinfo() and found out that the default timezone was detected as America/Chicago. This was not the case as the server was configured for Canada/Saskatchewan (CST). I found out that I ended up having to directly set my timezone in php.ini file. I put the following in my php.ini file, then restarted Apache and the problem was resolved.

date.timezone = “Canada/Saskatchewan”

I’m not sure if this is a bug in PHP not detecting the timezone correctly. I tried searching through known PHP Bugs but no luck locating my problem. By the way, I’m running Apache with PHP/MySQL on OpenBSD i386 v3.7.

Thanks to TML from IRC channel ##php on freenode for helping me resolve the problem.

Comments are closed.

Take back your mailbox - CAUCE.org

Powered By Wordpress PHP: Hypertext Preprocessor MySQL Powered Download Juice, the cross-platform podcast receiver
Proud To Be Canadian Get Firefox Valid XHTML Valid CSS
<NO>OOXML Logo


25 queries. 0.259 seconds.
Copyright © 2004 - 2005 by Adam Douglas