Skip to main content

Useful date routines.

Project description

dt8601 (short for “dates in ISO8601 logic”) provides useful functionality to work with gregorian dates. This is my first open source project in Python, so please bear with me. The code is based on a date library I wrote back in to 90s in another language and has proven to be very helpful when you have to work with date arithmetic.

Quick start

dt8601 provides two objects to work with dates. One allows for easy storages and calculations with a date and the other provides functionality that is associated with a calendar year.

Typical usage in most cases is as easy as this:

#!/usr/bin/env python

import dt8601

ymd = dt8601.IsoDate(2013, 06, 25, 'DE')
year = dr8601.IsoYear(2013)

num_weeks = year.week_count  # number if weeks in 2013

print(ymd.day_of_year())   # day of year
print(ymd.day_of_week())   # get week day for 2013-06-25
print(ymd.week_of_year())  # get ISO calendar week for 2013-06-25

You would like to get a list of all the start dates for every ISO calendar week in 2013? As easy as:

from dt8601 import IsoYear

yr = IsoYear(2013)

for the_week in yr.iso_weeks:
    print(the_week['start'])

You can find more information in the docs folder (es gibt auch eine deutsche Doku dort!)

Thanks also to

This module is a result of porting and reworking a Borland Delphi library that is now more than 20 years old (yes, we had computers back then <g>). Many people inspired this library, helped and added code or explained things.

Bernd Strehuber - Holiday calculations Carley Phillips - Julian date calculations Jeff Duntemann - Weekday calculations Judson McClendon - Easter calculations Martin Austermeier - Weekday calculations Paul Schlyter - Easter calculation Pit Biernath - Julian date calculations Scott Bussinger - Julian date calculations Markus Kuhn for his ISO8601 summary

Also many thanks to the Wikipedia authors of the ISO8601 articles and last, but not least, the awesome group of people on http://www.stackoverflow.com

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

dt8601-0.2.0.tar.gz (189.3 kB view details)

Uploaded Source

File details

Details for the file dt8601-0.2.0.tar.gz.

File metadata

  • Download URL: dt8601-0.2.0.tar.gz
  • Upload date:
  • Size: 189.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dt8601-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a10c9d4a06090a5c5b3ddee919582928c5eb63aaa9509400f1612edc8cc96f15
MD5 84f85d82a8b246850f632ae9f134889f
BLAKE2b-256 edb614529962aa2c766ba27615f8f19c884bd05d652ed7ec92242a234752aeed

See more details on using hashes here.

Supported by

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