Skip to main content

Python module for determining if a datetime is within a time period

Project description

Python module for determining if a datetime is within a time period.

Based on the original TimePeriod module written by Paul Boyd <boyd.paul2@gmail.com>.

Installation

$ sudo pip install timeperiod2

Usage

import datetime
import timeperiod
# will return True iff we have Monday, Tuesday or Thursday:
timeperiod.in_period('wd {mon tue thu}')
# will return True iff we have "office time"
timeperiod.in_period('wd {Mon-Fri} hr {9-17}', datetime.datetime.now())

License

Released under the LGPL:

http://www.gnu.org/licenses/#LGPL

Also see the LICENSE file.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Files for timeperiod2, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size timeperiod2-0.1.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page