Skip to content
Friendly Python Dates
Python
Pull request Compare This branch is 71 commits behind dirn:develop.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
docs
tests
.gitignore
.travis.yml
LICENSE
MANIFEST.in
Makefile
README.rst
setup.py
when.py

README.rst

When.py: Friendly Dates and Times

https://secure.travis-ci.org/dirn/When.py.png?branch=master

User-friendly functions to help perform common date and time actions.

Usage

To get the system time zone's name:

when.timezone()

To get the current date:

when.today()

To get tomorrow's date:

when.tomorrow()

To get yesterday's date:

when.yesterday()

To get a datetime one year from now:

when.future(years=1)

To convert to a different time zone:

when.shift(value, from_tz='America/New_York', to_tz='UTC')

To get the current time:

when.now()

Full documentation can be found on Read the Docs.

Installation

Installing When.py is easy:

pip install whenpy

or download the source and run:

python setup.py install
Something went wrong with that request. Please try again.