My current code raises following error:
return convert.strftime("%-d %B %Y year %-H {hour} %-M {minute}")
ValueError: Invalid format string
My Code:
def date_time(time_input: str) -> str:
hour = "hours"
minute = "minutes"
convert = datetime.datetime.strptime(time_input, "%d.%m.%Y %H:%M")
if convert.hour == 1:
hour = "hour"
if convert.minute == 1:
minute = "minute"
return convert.strftime(f"%-d %B %Y year %-H {hour} %-M {minute}")
But why ?!
Created at: 2020/09/20 18:11; Updated at: 2020/09/23 15:33
The question is resolved.