Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
string Interpolation -> f-string solution in Clear category for Date and Time Converter by xndrllyd
from datetime import datetime
def date_time(time: str) -> str:
dt = datetime.strptime(time, '%d.%m.%Y %H:%M')
return f'{dt.day} {dt:%B} {dt.year} year {dt.hour} hour{"s" if dt.hour != 1 else ""} {dt.minute} minute{"s" if dt.minute != 1 else ""}'
Dec. 17, 2020