Parameters & Returns
Parameters
Returns
Quick Summary
Converts 24-hour time to 12-hour format and sets AM/PM flag.
Takes hour24 (24-hour format hour 0-23), isPM (pointer to store AM/PM flag).
Returns the 12-hour hour value (1-12).
Technical Exegesis...
Converts a 24-hour format hour (0-23) to 12-hour format (1-12) and sets the isPM parameter. The isPM parameter is a pointer that will be set to 1 if PM (hours 12-23), or 0 if AM (hours 0-11). If isPM is NULL, only the conversion is performed.
Conversion rules: hour 0 becomes 12 AM (midnight), hours 1-11 stay the same (AM), hour 12 stays 12 (PM/noon), hours 13-23 are converted to 1-11 (PM). Returns the 12-hour hour value (1-12). Useful for displaying time in 12-hour format with AM/PM indicators.