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
def castDatetime(value, cur): return iso8601.parse(value)