Timezone Issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Tushar07
Forum Newbie
Posts: 1
Joined: Thu Apr 21, 2011 6:11 am

Timezone Issue

Post by Tushar07 »

Hi,

I have set the Timezone in the PHP.ini file as follows:-

; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "Asia/Calcutta"

; http://php.net/date.default-latitude
;date.default_latitude = 31.7667


But when i PHP -info from the command prompt i get the following -

date

date/time support => enabled
"Olson" Timezone Database Version => 2010.15
Timezone Database => internal
Default timezone => Asia/Kolkata

Directive => Local Value => Master Value
date.default_latitude => 31.7667 => 31.7667
date.default_longitude => 35.2333 => 35.2333
date.sunrise_zenith => 90.583333 => 90.583333
date.sunset_zenith => 90.583333 => 90.583333
date.timezone => no value => no value

Can you please tell me even after setting the timezone to Asia/Calcutta why it shows it as No Value. I am using IIS7

Thanks,
Tushar
incubi
Forum Contributor
Posts: 119
Joined: Mon Dec 07, 2009 1:47 pm

Re: Timezone Issue

Post by incubi »

Hi,
Using PHP on the command line may use a different php.ini then running phpinfo.php in a browser.

change dir to where the php.ini is that you know you set and try this.

php -c ./ -info

This will use the ini file in the directory you are in and not the one that could be in your path.


Lee
fugix
Forum Contributor
Posts: 207
Joined: Fri Mar 18, 2011 8:01 pm

Re: Timezone Issue

Post by fugix »

also..make sure to restart your server after changing your php.ini file....otherwise the changes wont be set
Post Reply