How to parse date from string with Python

1 Answer

0 votes
from datetime import datetime

s = "October 19, 2020"

d = datetime.strptime(s, "%B %d, %Y")

print(d)



'''
run:

2020-10-19 00:00:00

'''

 



answered Oct 19, 2020 by avibootz

Related questions

1 answer 149 views
149 views asked Aug 7, 2020 by avibootz
1 answer 147 views
1 answer 221 views
1 answer 237 views
1 answer 206 views
...