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


Download files

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

Source Distribution

timeperiod2-0.1.tar.gz (4.2 kB view details)

Uploaded Source

File details

Details for the file timeperiod2-0.1.tar.gz.

File metadata

  • Download URL: timeperiod2-0.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for timeperiod2-0.1.tar.gz
Algorithm Hash digest
SHA256 9769f8bfa88fcf5a9fffb2d0c0cb13f57563d007d8dc5d01b6816e58edf79fe6
MD5 8e5839aca8c594ff494d661a70d347e8
BLAKE2b-256 6e9b12f57faebf030d8b872d06d151832e88c7251fa5a9af629ce049a88d0c24

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page