datetime.strptime () throws 'does not match format' error

后端 未结 3 2249
无人共我
无人共我 2021-02-19 15:27

I get

time data \'19/Apr/2011:22:12:39\' does not match format \'%d/%b/%y:%H:%M:%S\'

when using datetime.strptime(\'19/Apr/2011:22:12:39\

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-19 15:50

    You want %Y instead of %y. %Y means you want the century, %y is no century and the year is displayed from 00 to 99.

提交回复
热议问题