#79 - Change Time Format

+500 points
Contributed by: Mehdi Maujood

13:50 and 01:50 PM are 24-hour and 12-hour representations of the same time. Implement the method changeTimeFormat that takes as input a string strTime formatted as a 24-hour string, and returns the equivalent 12-hour string.

Examples:

changeTimeFormat('08:05') returns '08:05 AM'

changeTimeFormat('00:05') returns '12:05 AM'

changeTimeFormat('23:15') returns '11:15 PM'

Discuss this problem on the ApexSandbox.io Trailblazer Community Group

Loading...