Skip to content

Instantly share code, notes, and snippets.

@codeperfectplus
Created September 27, 2023 09:47
Show Gist options
  • Save codeperfectplus/f5b2fdda235bc722b3ba20aaaf276556 to your computer and use it in GitHub Desktop.
Save codeperfectplus/f5b2fdda235bc722b3ba20aaaf276556 to your computer and use it in GitHub Desktop.
import os
import sys
def timeConversion(s):
#
# Write your code here.
#
time = s.split(':')
if s[-2:] == "PM":
if time[0] != "12":
time[0] = str(int(time[0])+12)
else:
if time[0] == '12':
time[0] = '00'
ntime = ':'.join(time)
return str(ntime[:-2])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment