codedamn

Don't have any idea to convert 12hr time format to 24hr time format

Asked by Harsh Kumar Jha about 2 years ago

1

I am enrolled in 50DaysOfJS and right now im at 4th problem. Its about converting the 12hr time format to 24hr time format. I am unable to understand the logic. How should i proceed??

1 Answer

    3

    12 AM == 00 Hrs 1 AM == 01 Hrs . . 11 AM == 11 Hrs

    12 PM == 12 Hrs 1 PM == 13 Hrs ...(1 AM + 12) . . 11 PM == 23 Hrs ....(11 AM + 12)

    Try using these start and end condtions for AM and PM. These should help.

    @urmezp

    Urmez Panthaki

    @urmezp

Your answer