How to use the ciso8601.parse_datetime_as_naive function in ciso8601

To help you get started, we’ve selected a few ciso8601 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 closeio / ciso8601 / tests.py View on Github external
def test_parse_as_naive_auto_generated_valid_formats(self):
        for (timestamp, expected_datetime) in generate_valid_timestamp_and_datetime():
            try:
                self.assertEqual(ciso8601.parse_datetime_as_naive(timestamp), expected_datetime.replace(tzinfo=None))
            except Exception:
                print("Had problems parsing: {timestamp}".format(timestamp=timestamp))
                raise
github liampauling / betfair / betfairlightweight / compat.py View on Github external
def parse_datetime(datetime_string):
        try:
            return ciso8601.parse_datetime_as_naive(datetime_string)
        except ValueError:
            return
except ImportError:
github jclgoodwin / bustimes.org / vehicles / management / commands / import_go_ahead.py View on Github external
def get_datetime(item):
        return timezone.make_aware(parse_datetime_as_naive(item['recordedTime']))
github trustpilot / python-sanicargs / sanicargs / __init__.py View on Github external
def __parse_date(date_string):
    return ciso8601.parse_datetime_as_naive(date_string).date()
github trustpilot / python-sanicargs / sanicargs / __init__.py View on Github external
def __parse_datetime(date_string):
    return ciso8601.parse_datetime_as_naive(date_string)

ciso8601

Fast ISO8601 date time parser for Python written in C

MIT
Latest version published 16 days ago

Package Health Score

88 / 100
Full package analysis

Similar packages