Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Third: forced use of .format solution in Clear category for Date and Time Converter by leggewie
from time import strftime, strptime
def date_time(time: str) -> str:
st = strptime(time, "%d.%m.%Y %H:%M")
d = strftime("%-d %B %Y year", st)
h = str(st.tm_hour) + " hour" + str(("s"*(not st.tm_hour == 1))) # plural-s for hours
m = str(st.tm_min) + " minute" + str("s"*(not st.tm_min == 1)) # plural-s for minutes
result = "{d} {h} {m}".format(d=d,h=h,m=m)
return result
June 4, 2021