How would I compute exactly 30 days into the past with Python (down to the minute)?
Solution 1:
You want to use a datetime
object instead of just a date
object:
start_date = datetime.datetime.now() - datetime.timedelta(30)
date
just stores a date and time
just a time. datetime
is a date with a time.