python-dateutil: A delightful romp in the never-confusing world of dates and times
12:15 PM - 12:40 PM on July 17, 2016, Room CR5Paul Ganssle
- Audience level:
- novice
- Watch:
- https://www.youtube.com/watch?v=X_bCto95Imc
Description
The dateutil library provides a number of extensions to Python's standard datetime handling libraries. This talk will provide an overview of how to use (and not use!) dateutil to improve your datetime-handling experience, and also cover some of the recent changes to the library.
Abstract
Human methods of timekeeping are complicated, sometimes reflecting the underlying complexity of the natural cycles of life on earth, sometimes historical lock-in. dateutil attempts to provide tools to make dealing with the numerous datetime-handling standards and edge cases a bit easier.
This talk will give an overview on how to use dateutil for:
- Time zones:
- The tz module provides a number of tzinfo subclasses to make it easy to incorporate time zone data from various formats into your application.
- Arithmetic:
- The relativedelta and (forthcoming) absolutedelta classes provide an unambiguous way to perform specific arithmetical operations on datetimes.
- Recurrence rules:
- The rrule module implements the iCalendar RFC2445 specification for recurrence rules, allowing you to generate dates by a specific rule, e.g. "every third sunday in 2016" or "every 5 minutes from 9AM to 5PM every Monday through Friday".
- Datetime parsing:
- The parser module is designed to take any string that looks like a date and/or time and turn it into a Python datetime object.
- Easter:
- The easter module allows you to calculate the date of easter on any given year, using either the Western, Orthodox or Julian algorithm.