Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Generate and parse RFC 3339 timestamps

Project description

Description

https://travis-ci.org/kurtraschke/pyRFC3339.svg?branch=master

pyRFC3339 parses and generates RFC 3339-compliant timestamps using Python datetime.datetime objects.

>>> from pyrfc3339 import generate, parse
>>> from datetime import datetime
>>> import pytz
>>> generate(datetime.utcnow().replace(tzinfo=pytz.utc)) #doctest:+ELLIPSIS
'...T...Z'
>>> parse('2009-01-01T10:01:02Z')
datetime.datetime(2009, 1, 1, 10, 1, 2, tzinfo=<UTC>)
>>> parse('2009-01-01T14:01:02-04:00')
datetime.datetime(2009, 1, 1, 14, 1, 2, tzinfo=<UTC-04:00>)

Installation

To install the latest version from PyPI:

$ pip install pyRFC3339

To install the latest development version:

$ pip install https://github.com/kurtraschke/pyRFC3339/tarball/master#egg=pyRFC3339-dev

To build the documentation with Sphinx:

  1. $ pip install Sphinx
  2. $ python setup.py build_sphinx

The documentation is also available online at:

https://pythonhosted.org/pyRFC3339/

Project details


Download files

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

Files for pyRFC3339, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size pyRFC3339-1.0-py2.py3-none-any.whl (8.4 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size pyRFC3339-1.0.tar.gz (9.3 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