Reputation: 23317
I dont know why I'm not getting the correct date and time in my region. Here's the code
<?php
//date_default_timezone_set('Asia/Manila');
echo date('YYYY-mm-dd H:i:s'); ?>
Even if I comment out or change the time zone the date and time that I'm getting is still the same. The date today is 23. But its outputting 22. And the time doesn't change even if I change the time zones. Does it have something to do with my computer? Because I sometimes notice that the clock on the lower right corner of the screen is not displaying the correct time.
Heres the current time, but its displaying this:
01-22-2011 05:38:31-PM
Upvotes: 0
Views: 473
Reputation: 41
Are you from the Philippines? This worked for me for some reason:
date_default_timezone_set('Asia/Tbilisi');
Asia/Manila
is not working for me too. Just give it a try.
Upvotes: 0
Reputation: 107806
Are you sure that's the script producing the output shown?
echo date('YYYY-mm-dd H:i:s'); ?>
Doesn't seem to match the format of
01-22-2011 05:38:31-PM
Other than that, the timezone setting looks right.
Upvotes: 1
Reputation: 3049
It could be that time set up on server (where PHP script is being executed) is not correct.
Upvotes: 1