コード例 #1
0
ファイル: xmlhelper.py プロジェクト: NORDUnet/opennsa
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
コード例 #2
0
ファイル: xmlhelper.py プロジェクト: magiclamp2/opennsa
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
コード例 #3
0
ファイル: database.py プロジェクト: magiclamp2/opennsa
def castDatetime(value, cur):
    return iso8601.parse(value)
コード例 #4
0
ファイル: database.py プロジェクト: gracehllee/opennsa
def castDatetime(value, cur):
    return iso8601.parse(value)