Military or standard time?

Posted on 2004-11-18
Last Modified: 2012-06-27
$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
Question by:erikcook
    LVL 27

    Accepted Solution

    Its 24 hour time so military.

    LVL 27

    Expert Comment

    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

    LVL 1

    Expert Comment

    if  this is your code

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

    then you get 'standard time'.
    LVL 27

    Expert Comment

    From manual: "hours" - Numeric representation of hours - 0 to 23

    24 hour - military time

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    This is a general how to create your own custom plugin system for your PHP application that you designed (or wish to extend a third party program to have plugin functionality that doesn't have it yet).  This is not how to make plugins for existing s…
    A colleague recently asked me about how to give his client a small part of the web site that could be completely under the client's control.  Since I have done this sort of thing before to add emergency banners to a web site, I decided I would creat…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to count occurrences of each item in an array.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now