Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Concise (using datetime module) solution in Clear category for Date and Time Converter by scribani.andres
def date_time(time: str) -> str:
import datetime
date = datetime.datetime.strptime(time, '%d.%m.%Y %H:%M')
hrs = ['hours', 'hour'][date.strftime('%H') == '01']
mins = ['minutes', 'minute'][date.strftime('%M') == '01']
return date.strftime('%-d %B %Y year %-H ' + hrs +' %-M ' + mins)
April 27, 2020
Comments: