now() or current_timestamp() and the hours value in time

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yasaswi

    now() or current_timestamp() and the hours value in time

    When I run select now(); or select current_timesta mp(), I see the
    output like "2005-04-19 02:50:14". By reading the documentation I
    thought the the hour value should be in military format namely 14, but
    instead I see 02. How can I fix this problem? I have MySQL 4.1.10a
    database running on RH 9.0 server.
    Thanks,
    Yasaswi

  • Bill Karwin

    #2
    Re: now() or current_timesta mp() and the hours value in time

    yasaswi wrote:[color=blue]
    > When I run select now(); or select current_timesta mp(), I see the
    > output like "2005-04-19 02:50:14". By reading the documentation I
    > thought the the hour value should be in military format namely 14, but
    > instead I see 02. How can I fix this problem?[/color]

    Read about the DATE_FORMAT() function on this page:


    You can force military-style 24-hour format by using the %H or %T format
    specifiers.

    Regards,
    Bill K.

    Comment

    Working...