Is there a built-in method for converting a date to a datetime in Python, for example getting the datetime for the midnight of the giv
date
datetime
One way to convert from date to datetime that hasn't been mentioned yet:
from datetime import date, datetime d = date.today() datetime.strptime(d.strftime('%Y%m%d'), '%Y%m%d')