Why is datetime.strptime not working in this simple example?

前端 未结 6 1167
轻奢々
轻奢々 2020-12-08 09:24

I\'m using strptime to convert a date string into a datetime. According to the linked page, formatting like this should work:

>>> # Usi         


        
6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-08 09:55

    You should be using datetime.datetime.strptime. Note that very old versions of Python (2.4 and older) don't have datetime.datetime.strptime; use time.strptime in that case.

提交回复
热议问题