I have this script what gets me the last datetime from a database table:
import MySQLdb
import datetime as dt
database = MySQLdb.connect (host="localhost", user = "root", passwd = "1234", db = "meh")
cursor = database.cursor()
query_timestamp = "SELECT refuelling_date FROM `emil_touch_fuellings` ORDER BY refuelling_date DESC LIMIT 1"
cursor.execute(query_timestamp)
dblastentrytime = cursor.fetchone()
for i in dblastentrytime:
current=i
startdate= current.strftime('%d/%m/%Y')
enddate = dt.datetime.today().strftime("%d/%m/%Y")
cursor.close()
print startdate
This will output 05/10/2016, but I want to get +1 to day to get 06/10/2016. Each time I run my script I want to get my startdate var with a +1 day on date I got from my db. I'm using python.