Convert Date String to Day of Week

You might want to use strptime and strftime methods from datetime:

>>> import datetime
>>> datetime.datetime.strptime('January 11, 2010', '%B %d, %Y').strftime('%A')
'Monday'

or for 'Mon':

>>> datetime.datetime.strptime('January 11, 2010', '%B %d, %Y').strftime('%a')
'Mon'

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)