The string
date2check = to_datetime(str(last_tx.year) + \
'-' + str(int(last_tx.month)-3) + \
'-' + str(last_tx.day) + \
' ' + str(last_tx.hour) + \
':' + str(last_tx.minute) + \
':' + str(last_tx.second))
works without problem but I want to know if there is some way to re-write this more appropiately (in a pythonic way). last_tx
is a datetime object.