My input to this is in the format 07:05:09PM expected output:
19:05:09
output got:
19:5:9
def timeConversion(s):
if "AM" in s:
print(s[1:8])
else:
string=s.split(':')
print(string)
string.append(string[2][0:2])
string.remove(string[2])
print(string)
date=list(map(int, string))
print(date)
a=date[0]+12
b='%s:%s:%s' % (a, date[1], date[2])
return b
My question is when I convert the date from string to int using map the zero is not picked up, is there any way to get the integer as such???