Date problem

The below runs fine but could someone advise how to input today’s date to value a, instead of a hardcoded date?

import datetime
import time

print ("Welcome to the WHT Kaizen predictor!")
a = datetime.datetime.strptime("2019,08,21","%Y,%m,%d")
b = datetime.datetime.strptime("2019,12,31","%Y,%m,%d")
numdays = (b-a).days 

Hey @object5367515062!
If you want to set a to the exact time it is right now, you can use this block of code:

import datetime

a = datetime.datetime.now()

Hope this helps!

5 Likes