Reputation:
Hi there I am creating a Flask application and I want to find out the number of days left to a certain date let's say 2nd of August. How would I do so.
Upvotes: 0
Views: 50
Reputation: 31
You can use the datetime
library to do that:
from datetime import date
start_date = date(2020, 6, 2)
end_date = date(2020, 6, 11)
delta = start_date - end_date
print(delta.days)
Upvotes: 2