Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have this question in stackoverflow which is about getting incorrect date in php: http://stackoverflow.com/questions/4771775/cannot-get-the-correct-date-and-time-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
add comment

1 Answer

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
1  
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
show 1 more comment

Your Answer

 
discard

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.