Jazz
Jazz

Reputation: 649

PHP script dispaying wrong time

My PHP script is displaying the wrong time. For eg. the time on my system is 3:10 PM while the script shows 9:40 AM.

I am working on Windows XP. The server package is that of "yPortable WebServer". Checking some other questions on this site I even made the following change => date.timezone = "Asia/Calcutta", in the php.ini.dist and php.ini files. But still no change.

Upvotes: 0

Views: 111

Answers (3)

Jazz
Jazz

Reputation: 649

Setting the timezone in the code worked just fine. Thank You!

OK! This seems silly. I just restarted the OS itself, and it seems to work without setting the timezone in the code. Some glitch somewhere, maybe because the system was on continuously for too long(couple of days).

Upvotes: 0

wyred
wyred

Reputation: 574

Have you tried echo-ing date('e') or date('r') to see if you have set the timezone settings correctly?

Upvotes: 1

Carlo Moretti
Carlo Moretti

Reputation: 2250

It's a good idea to always set default timezone in your script when using date functions.

Upvotes: 4

Related Questions