Friday, July 29, 2011

[phpXperts] Re: Set default timezone in Codeigniter

 

I tested your code in my pc, it also shows GMT +7. I looked further and ran following code

$timezone = new datetimezone("asia/dhaka");
$transitions = $timezone->gettransitions();

print_r($transitions);


Last entry of the array was

 Array
(
[ts] => 1245430800
[time] => 2009-06-19T17:00:00+0000
[offset] => 25200
[isdst] => 1
[abbr] => BDST
)

Note that isdst is set to 1. So it seems that my and your php version was build during Daylight Saving Time period in Bangladesh.
Also it is hardcoded. Now way to change timezone info.

So it is not a good idea to depend on php's timezone information. Controlling it manually would solve this.



__._,_.___
Recent Activity:
Visit phpXperts website at www.phpxperts.net
.

__,_._,___

No comments: