Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Human readable datetime deltas

Project Description

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 History

This version
History Node

0.3.1

History Node

0.3

History Node

0.2

History Node

0.1

Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
human-datetimedelta-0.3.1.tar.gz
(1.9 kB) Copy SHA256 Hash SHA256
Source None Mar 17, 2013

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting