Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Date and Time Converter by deciver5
from datetime import datetime
def date_time(time: str) -> str:
date = datetime.strptime(time, "%d.%m.%Y %H:%M")
end_h,end_m="s","s"
if date.strftime("%-M") == "1" : end_m=""
if date.strftime("%-H") == "1" : end_h=""
return date.strftime(f"%-d %B %Y year %-H hour{end_h} %-M minute{end_m}")
Aug. 1, 2022