PHP: How to change date() function to Central Time (-6)
I'm using the date function to be displayed for each of my new posts in a CMS. However, I do not know how to change that value according to my timezone, which is UTC−06:00.
This is how I'm doing it:
$p['time'] = date("F j, Y, h:i a");
$time = $p['time'];
And this is how it looks:
August 24, 2011, 4:39 pm
Right now if the current time is 10:39 AM, t开发者_Python百科he $time reported should be 4:39PM. I need to get rid of those extra 6 hours somehow.
You could try calling date_default_timezone_set
before all your time handling.
date_default_timezone_set("America/Belize");
Timezones reference
精彩评论