SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot spybreak's Avatar
    Join Date
    Apr 2003
    Location
    Germany
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question strtotime weirdness

    Hi! Another question from me. This one's out of plain curiosity.

    Why does:
    PHP Code:
    echo date('F j, Y, g:i a',strtotime('12:00 today')); //expected: 12 am 
    output 12 pm

    while

    PHP Code:
    echo date('F j, Y, g:i a',strtotime('00:00 today')); //expected: 12 pm 
    outputs 12 am?

    Shouldn't it be the other way around? If not, then why not?

  2. #2
    SitePoint Zealot devscripts's Avatar
    Join Date
    Sep 2004
    Location
    ur monitor
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    actually on the 24 hour clock, 00:00 is 12:00am at night, and 12:00 is pm... during the day.

    00:00 12am
    01:00 1am
    02:00 2am
    03:00 3am
    ..
    ..
    09:00 9am
    10:00 10am
    11:00 11am
    12:00 12pm past midday

    hope this clears this up for you?.
    "None of you [truly] believes until he wishes for his brother what he wishes for himself." By The one and Only Prophet Mohammed (Peace and blessings be upon him)

  3. #3
    SitePoint Zealot spybreak's Avatar
    Join Date
    Apr 2003
    Location
    Germany
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh ok, thanks. Didn't know that. Thanks =)


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
  •