I've a small script where I'm getting data from the last few months, based on the timestamp. Right now I'm using current day and a set date (currently May). Here's how I'm defining it:
today_time = int(time.mktime(date.today().timetuple())*1000000)
earlier_time = int(time.mktime(datetime.date(2011,05,01).timetuple())*1000000)
I'd like to change earlier_time
from a set date (currently 2011,05,01) to, say, 90 days. I couldn't find how to do this, so your help would be very appreciated.
import datetime
now = datetime.datetime.now()
then = now - datetime.timedelta(days=90)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With