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)
| 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 |