0
import dateparser

to_parse = '20210126231003'
parsed = dateparser.parse(to_parse, date_formats=['%Y%m%d%H%M%s'])

print(to_parse)
print(parsed)

I am expecting it to resolve to Jan 26 2021... but it instead resolved to some date in 2034.

20210126231003
2034-01-16 03:23:43

I am curious on why this is happening. Is my understanding for the parser's functioning wrong?

Sameer Sawla
  • 729
  • 6
  • 20

1 Answers1

0

As mentioned in the comment, the format specifier for second was wrong. it should had been %S.

Closing the question.

Sameer Sawla
  • 729
  • 6
  • 20