Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 525
  • Last Modified:

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
0
erikcook
Asked:
erikcook
  • 3
1 Solution
 
Diablo84Commented:
Its 24 hour time so military.

see: http://us2.php.net/manual/en/function.getdate.php
0
 
Diablo84Commented:
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
0
 
compustarsgCommented:
if  this is your code

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

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

24 hour - military time
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now