Skip to main content

Examples:

from datetime import datetime, timedelta

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

import human

print human.date(now)                      # 'now'
print human.date(an_hour_ago)              # 'an hour ago'
print human.date(an_hour_ago, short=True)  # '1h ago'
print human.date(an_hour_ago, asdays=True) # 'today'
print human.date(yesterday, short=True)    # 'yest'
print human.date(tomorrow)                 # 'tomorrow'

Release files for human-datetimedelta 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for human-datetimedelta 0.3.1
File Size Uploaded
human-datetimedelta-0.3.1.tar.gz 1.9 kB Details

Release files / human-datetimedelta-0.3.1.tar.gz

Download URL human-datetimedelta-0.3.1.tar.gz
Size 1.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e90cf1d37fd5b8800671383bbdc60cbb300b9628f74f291b0652ba7d1cce46fa
BLAKE2b-256 checksum
How to use checksums
8f0a15215fb58bcde0614a69e0b563cde9335a03b84d9ec14e771214409febd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.1 This release

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page