import datetime
import math
issuedate = datetime(2019,5,9) #calculate the issue datetime
current_date = datetime.datetime.now() #calculate the current datetime
diff_date = current_date - issuedate #//calculate the date difference with time also
amount = fine #you want change
if diff_date.total_seconds() > 0.0: #its matching your condition
days = math.ceil(diff_date.total_seconds()/86400) #calculate days (in
one day 86400 seconds)
deductable_amount = round(amount,2)*days #calclulated fine for all days
import datetime
date = datetime.datetime(2000, 1, 1) # Replace with whatever you want
now = datetime.datetime.now() # You can even find the current date and time using this expression
if date < now:
print('past')
elif date > now:
print('future')
else:
print('present')
# This would print "past"