You are viewing a single comment's thread. Return to all comments →
I have written the same login in python.
t = time.rstrip('APM').split(':') t[0] = int(t[0]) t[0] = t[0] % 12 if 'PM' in time: t[0] += 12 t[0] = str(t[0]) time = ':'.join(t) print time
For me it is not able to paas all the test. Its saying it is failing on 12:40:22AM. But when I am testing the output it seems working fine.
Time Conversion
You are viewing a single comment's thread. Return to all comments →
I have written the same login in python.
t = time.rstrip('APM').split(':') t[0] = int(t[0]) t[0] = t[0] % 12 if 'PM' in time: t[0] += 12 t[0] = str(t[0])
time = ':'.join(t) print time
For me it is not able to paas all the test. Its saying it is failing on 12:40:22AM. But when I am testing the output it seems working fine.