Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

dirn/When.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

25d40a8 · Oct 14, 2017
Feb 16, 2015
Mar 25, 2013
May 24, 2012
Sep 4, 2012
Feb 16, 2015
Feb 16, 2015
Mar 20, 2013
Mar 20, 2013
Oct 14, 2017
Feb 16, 2015
Feb 16, 2015
Feb 16, 2015
Feb 27, 2016

Repository files navigation

When.py: Friendly Dates and Times

No Maintenance Intended

Production: travismaster coverallsmaster

Development: travisdevelop coverallsdevelop

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