Exemplo n.º 1
0
def parseXMLTimestamp(xsd_timestamp):

    dt = iso8601.parse(xsd_timestamp)

    if dt.utcoffset() is None:
        # this needs to changed to valueerror...
        raise error.PayloadError('Timestamp has no time zone information')

    # convert to utc and remove tz info (internal use)
    utc_dt = dt.astimezone(UTC()).replace(tzinfo=None)
    return utc_dt
Exemplo n.º 2
0
def parseXMLTimestamp(xsd_timestamp):

    dt = iso8601.parse(xsd_timestamp)

    if dt.utcoffset() is None:
        # this needs to changed to valueerror...
        raise error.PayloadError('Timestamp has no time zone information')

    # convert to utc and remove tz info (internal use)
    utc_dt = dt.astimezone(UTC()).replace(tzinfo=None)
    return utc_dt
Exemplo n.º 3
0
def castDatetime(value, cur):
    return iso8601.parse(value)
Exemplo n.º 4
0
def castDatetime(value, cur):
    return iso8601.parse(value)