Convert Date String to Day of Week

后端 未结 6 1904
走了就别回头了
走了就别回头了 2020-12-08 04:27

I have date strings like this:

\'January 11, 2010\'

and I need a function that returns the day of the week, like

\'mon\', o         


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

    use date.weekday() Return the day of the week as an integer, where Monday is 0 and Sunday is 6.

    http://docs.python.org/2/library/datetime.html#datetime.date.weekday

提交回复
热议问题