Page 1 of 1

problem with setting to local time

Posted: Wed Aug 13, 2008 1:53 am
by susrisha
Hi i am using php 5.2.6 supported for apache 2.2.8

My problem is to get the localtime displayed on a particular script. The local time of my place is 5 1/2 hrs more than the GMT. By default the system shows the GMT. I have tried it two ways.. First thing to set the php.ini file as below:

Code: Select all

 
date.timezone = Asia/Kolkata
 
I saved the php.ini file and restarted the apache server. Still no use.. it still shows GMT

Next thing i changed in the code...

Code: Select all

 
date_default_timezone_set('Asia/Kolkata');
$time= date("Y.m.d H:i:s P");
 
OUTPUT for the code is

Code: Select all

 
2008.08.13 06:43:08 +00:00
 
can someone help me offset the time by default??

Re: problem with setting to local time

Posted: Wed Aug 13, 2008 4:03 am
by susrisha
figured it out somehow.. i didnt have php_dbtimezone.dll file. got it from internet.
And then Asia/kolkata is not existing..Hence i changed the timezone to Asial/Calcutta.
Working very smooth