Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
it's a python the way? ;) solution in Clear category for Time Converter (24h to 12h) by kdim
from datetime import datetime
def time_converter(time):
d = {
'ptime': lambda x: datetime.strptime(x, '%H:%M'),
'ftime': lambda x: x.strftime('%I:%M %p'),
'lower': lambda x: x.lower(),
'ddott': lambda x: x.replace('m', '.m.'),
'zeros': lambda x: x.lstrip('0')
}
for i in d:
time = d[i](time)
return time
Jan. 27, 2021
Comments: