I have this code:
$date = date("m/d/Y H:i:s");
But it displays 1 day advance for date and 5 hours late for time from my computer time.
For ex:
My date/time is 07/25/2011 10:12PM
this code displays:
07/26/2011 05:12:43
What could be the problem?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is probably running on a server in a different timezone than your computer. You can use
date_default_timezone_setto set it to the correct timezone before callingdate(); Find the correct timezone identifier for your timezone from this list: http://www.php.net/manual/en/timezones.php