SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2006
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Displaying Military time (24 hour clock)

    I know that I am overlooking something simple here, but I need to display military time... I have for example 8:30 to display with no problems, but for PM I need it to read 20:30. Using the following command line:

    $tim = date("g:i");

    Thanks in advance.

    Sparky
    Last edited by sparkie624; Jul 9, 2006 at 17:41.

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Good idea when using a function: Know what it does! Look up what 'g' and 'i' mean as parameters for date():

    http://us2.php.net/date

    date("G:i") is what you want.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •