Time Conversion

  • + 0 comments

    **Code in Python ** def timeConversion(s): h=s[:2] se=s[-2:] rest=s[2:-2] ho=int(h) if se=='AM': if ho==12: ho=0 else: if ho != 12: ho += 12 return f"{ho:02}{rest}"