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

前端 未结 6 1156
轻奢々
轻奢々 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条回答
  •  失恋的感觉
    2020-12-08 10:02

    Because datetime is the module. The class is datetime.datetime.

    import datetime
    dtDate = datetime.datetime.strptime(sDate,"%m/%d/%Y")
    

提交回复
热议问题