Link to home
Start Free TrialLog in
Avatar of erikcook
erikcook

asked on

Military or standard time?

$time = $today['hours'].":".$today['minutes'];

Will this read in military time or standard time? If standard, how do I add Post/Anti Meridian? AM/PM
ASKER CERTIFIED SOLUTION
Avatar of Diablo84
Diablo84

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Diablo84
Diablo84

Example for both using date:

$time =  date("H:i");
echo $time; //24 hour eg. 23:11

$time =  date("h:i a");
echo $time; //12 hour eg. 11:11 pm

see: http://us2.php.net/manual/en/function.date.php
if  this is your code

$today = getdate();
$time = $today['hours'].":".$today['minutes'];

then you get 'standard time'.
From manual: "hours" - Numeric representation of hours - 0 to 23

24 hour - military time