0

I have a CSV with time stamp data looks like this:

22/11/2018  10:21:34

And im parsing it this way : currentTime = dt.strptime(line[0], "%d/%m/%Y %H:%M:%S")

I have problem when parsing rows of this kind (when the seconds equal 00):

22/11/2018  10:21:00

i get : time data '22/11/2018 10:21' does not match format '%d/%m/%Y %H:%M:%S'

ATT
  • 921
  • 3
  • 13
  • 30
  • Are you sure the file really contains `:00` when the seconds are 0? The error message indicates that the time is missing that part of it. – Barmar Dec 03 '18 at 09:17
  • The result I get from `strptime()` for the second string is `2018-11-22 10:21:00`. – martineau Dec 03 '18 at 09:18
  • Actually its weird. I now have opened it with notepad and see indeed the stamp is only 22/11/2018 10:21. But when i opening with excel i see 22/11/2018 10:21:00. Any idea what should i do? – ATT Dec 03 '18 at 09:36

0 Answers0