I have a site which is located on a server in Nevada (US) but the site will only be accessed from Nebraska (US). When I call time() it's picking up a Pacific time when I need a Central time. So I decided to tweak the function a little bit.
First I did:
$date = date("M d, Y");
$realhour = date("h") + 2;
$realtime = date ("h:i:s A");
print 'The time is '.$realtime.' at last refresh.';
This increased the hour by 2, to get from pacific to central, but after 11:00 AM it went to 12:00 AM and then 13:00 PM, military time.
So I started doing searches through this forum and found an article on how to convert time using GMT. So now I'm using:
$letsgetthetime = date( "M d Y H:i:s A",
mktime(gmdate("H")+6,gmdate("i"),gmdate("s"),gmdate("m"),gmdate("d"),gmdate("Y")));
print 'The time is '.$letsgetthetime.' at last refresh.';
Which gave me the correct time, and not in military time, although A returns as AM when it should be PM. I'm getting 11:30 AM when its really 11:30 PM in US Central Time. Am I doing something wrong? I looked through the php.net documents on time and could only find how to format the actual time and not AM/PM, less I overlooked it...