Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

human readable time difference python

# pip install humanize
import humanize

date = datetime(2021, 6, 2, 8, 15, 0)
now = datetime.now()

humanize.precisedelta(date - now, minimum_unit="seconds", format="%d")
# '9 hours, 28 minutes and 59 seconds'
 
PREVIOUS NEXT
Tagged: #human #readable #time #difference #python
ADD COMMENT
Topic
Name
3+5 =