How to use the dateparser.utils.strptime.strptime function in dateparser

To help you get started, we’ve selected a few dateparser 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 scrapinghub / dateparser / tests / test_utils_strptime.py View on Github external
def when_date_string_is_parsed(self, date_string, fmt):
        try:
            self.result = strptime(date_string, fmt)
        except ValueError as e:
            self.result = e
github scrapinghub / dateparser / dateparser / parser.py View on Github external
def _get_date_obj(self, token, directive):
        return strptime(token, directive)
github scrapinghub / dateparser / dateparser / parser.py View on Github external
def __call__(self, timestring):
        _timestring = timestring
        for directive in self.time_directives:
            try:
                return strptime(timestring.strip(), directive).time()
            except ValueError:
                pass
        else:
            raise ValueError('%s does not seem to be a valid time string' % _timestring)