Reputation: 353
i'm simply trying to get the current date in PHP, but it's getting '07:45:23' when it's really 11:02am (the date part of it is correct). i am setting the timezone like this:
date_default_timezone_set('America/New_York');
$now = date('Y-m-d H:i:s');
why isn't this working? i also tried 'EDT'. and if it matters, the server is also in the same timezone.
thanks.
Upvotes: 0
Views: 2344
Reputation: 180147
Your server's time is likely incorrect. If you have SSH access, running date
will show you what the server is set to.
Upvotes: 1