Module bridge.lib.isodate
isodate.py
Functions for manipulating a subset of ISO8601 date, as specified by
<http://www.w3.org/TR/NOTE-datetime>
Exposes:
- parse(s)
s being a conforming (regular or unicode) string. Raises ValueError for
invalid strings. Returns a float (representing seconds from the epoch;
see the time module).
- parse_datetime(s) # if datetime module is available
s being a conforming (regular or unicode) string. Raises ValueError for
invalid strings. Returns a datetime instance.
- asString(i)
i being an integer or float. Returns a conforming string.
TODO:
- Precision? it would be nice to have an interface that tells us how
precise a datestring is, so that we don't make assumptions about it;
e.g., 2001 != 2001-01-01T00:00:00Z.
Thanks to Andrew Dalke for datetime support.
| Function Summary |
| |
_cross_test()
|
| |
asString(i)
given seconds since the epoch, return a dateTime string. |
| |
parse(s)
parse a string and return seconds since the epoch. |
| |
parse_datetime(s)
parse a string and return a datetime object. |
asString(i)
given seconds since the epoch, return a dateTime string.
-
|
parse(s)
parse a string and return seconds since the epoch.
-
|
parse_datetime(s)
parse a string and return a datetime object.
-
|