Date Strftime Python
import datetime
datetime.datetime.now().strftime ("%Y%m%d")
20151015
Clear Curlew
import datetime
datetime.datetime.now().strftime ("%Y%m%d")
20151015
import datetime
d = datetime.datetime.strptime("01/27/2012", "%m/%d/%Y")
print(d)
output ....
2012-01-27 00:00:00
Yes, the strftime() method returns a string representing date and time using
date,
time or
datetime object.