Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    12

    Unanswered: time format 24 hr to 12hr

    db2 v7.1 on linux.

    Is there any scalar function to covert time from 24 hr format to 12 hr format. The Data is stored in Time data type. e.g. 13:02:23 should be converted to 1:02:23 pm

    thanks in advance
    Amit

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    You can use the CHAR function with the USA option to convert the time to AM and PM. Check the SQL Reference manual for details. Manuals can be downloaded in PDF format at a website listed in the "Useful DB2 Stuff" thread.

  3. #3
    Join Date
    Sep 2003
    Posts
    12
    Thanks a lot.

    Originally posted by Marcus_A
    You can use the CHAR function with the USA option to convert the time to AM and PM. Check the SQL Reference manual for details. Manuals can be downloaded in PDF format at a website listed in the "Useful DB2 Stuff" thread.

Posting Permissions

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