Am/pm

This is a discussion on Am/pm within the C++ Programming forums, part of the General Programming Boards category; how do you display the AM/PM on the end of a time display? eg (11:10 to 11:10 AM)...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    16

    Am/pm

    how do you display the AM/PM on the end of a time display?
    eg (11:10 to 11:10 AM)

  2. #2
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    The code from the previous thread will give you hours in the 24 hour clock format, so you need to test the value contained in the tm_hour variable and append AM/PM depending on the value and minus 12 if it's PM.
    zen

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21