How to use the aniso8601.timezone.build_utcoffset function in aniso8601

To help you get started, we’ve selected a few aniso8601 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github johnwheeler / flask-ask / tests / test_core.py View on Github external
def test_parse_timestamp(self):
        utc = build_utcoffset('UTC', timedelta(hours=0))
        result = Ask._parse_timestamp('2017-07-08T07:38:00Z')
        self.assertEqual(datetime(2017, 7, 8, 7, 38, 0, 0, utc), result)

        result = Ask._parse_timestamp(1234567890)
        self.assertEqual(datetime(2009, 2, 13, 23, 31, 30), result)

        with self.assertRaises(ValueError):
            Ask._parse_timestamp(None)
github Jflick58 / DepressionAI / venv / lib / python3.6 / site-packages / aniso8601 / time.py View on Github external
#hhmmss±hhmm
    #hh:mm±hhmm
    #hhmm±hhmm
    #hh±hhmm
    #hh:mm:ss±hh
    #hhmmss±hh
    #hh:mm±hh
    #hhmm±hh
    #hh±hh

    (timestr, tzstr) = _split_tz(isotimestr)

    if tzstr == None:
        return _parse_time_naive(timestr)
    elif tzstr == 'Z':
        return _parse_time_naive(timestr).replace(tzinfo=build_utcoffset('UTC', datetime.timedelta(hours=0)))
    else:
        return _parse_time_naive(timestr).replace(tzinfo=parse_timezone(tzstr))