Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this question in stackoverflow which is about getting incorrect date in php:

Someone said that its localization issues. I have tried the script on my friend's computer. And the time is displayed correctly. I cannot move on with my project which needs to have the correct time if I can't solve this soon. What can you recommend?

share|improve this question
Are you sure you're calling the timezone function correctly? Which PHP version are you using? – Tobias Plutat Jan 24 '11 at 10:15

I think this points to a PHP issue. At any rate, your date_default_timezone_set call isn't interpreted, otherwise you'd get the proper time zone. Since date_default_timezone_set is PHP 5-only, I guess your friend is running a PHP 5 interpreter, while you're running the script through PHP 4. Try inserting echo (phpversion()); and see what it says.

share|improve this answer
I'm running 5.3.0 – Ieyasu Sawada Jan 24 '11 at 10:45
And phpversion() returns that? – Tobias Plutat Jan 24 '11 at 11:00
not exactly, it just said: 5.3.0 – Ieyasu Sawada Jan 24 '11 at 11:10
Okay, something else: What does PHP return on date_default_timezone_get()? – Tobias Plutat Jan 24 '11 at 11:36
you mean echo it? it returns 1 – Ieyasu Sawada Jan 24 '11 at 11:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.