Skip to main content

Human readable datetime deltas

Project description


from datetime import datetime, timedelta

now =
an_hour_ago = now - timedelta(hours=1)
yesterday = now - timedelta(days=1)
tomorrow = now + timedelta(days=1)

import human

print                      # 'now'
print              # 'an hour ago'
print, short=True)  # '1h ago'
print, asdays=True) # 'today'
print, short=True)    # 'yest'
print                 # 'tomorrow'

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for human-datetimedelta, version 0.3.1
Filename, size & hash File type Python version Upload date
human-datetimedelta-0.3.1.tar.gz (1.9 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page