Generate and parse RFC 3339 timestamps
Project description
Description
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:
$ pip install Sphinx
$ 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.
Source Distribution
pyRFC3339-1.1.tar.gz
(5.3 kB
view hashes)
Built Distribution
Close
Hashes for pyRFC3339-1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67196cb83b470709c580bb4738b83165e67c6cc60e1f2e4f286cfcb402a926f4 |
|
MD5 | f7c737b0b484c76bfd5e5b3a962db2ce |
|
BLAKE2b-256 | c17a725f5c16756ec6211b1e7eeac09f469084595513917ea069bc023c40a5e2 |