time data does not match format

前端 未结 6 1592
有刺的猬
有刺的猬 2020-12-02 14:24

I get the following error:

time data \'07/28/2014 18:54:55.099000\' does not match format \'%d/%m/%Y %H:%M:%S.%f\'

But I cannot see what pa

6条回答
  •  佛祖请我去吃肉
    2020-12-02 14:52

    I had a case where solution was hard to figure out. This is not exactly relevant to particular question, but might help someone looking to solve a case with same error message when strptime is fed with timezone information. In my case, the reason for throwing

    ValueError: time data '2016-02-28T08:27:16.000-07:00' does not match format '%Y-%m-%dT%H:%M:%S.%f%z'

    was presence of last colon in the timezone part. While in some locales (Russian one, for example) code was able to execute well, in another (English one) it was failing. Removing the last colon helped remedy my situation.

提交回复
热议问题