problem with setting to local time
Posted: Wed Aug 13, 2008 1:53 am
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:
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...
OUTPUT for the code is
can someone help me offset the time by default??
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
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");
Code: Select all
2008.08.13 06:43:08 +00:00