how to compare current date to future date pythono

Solutions on MaxInterview for how to compare current date to future date pythono by the best coders in the world

showing results for - "how to compare current date to future date pythono"
Cici
11 Jul 2018
1import datetime
2
3CurrentDate = datetime.datetime.now()
4print(CurrentDate)
5
6ExpectedDate = "9/8/2015 4:00"
7ExpectedDate = datetime.datetime.strptime(ExpectedDate, "%d/%m/%Y %H:%M")
8print(ExpectedDate)
9
10if CurrentDate > ExpectedDate:
11    print("Date missed")
12else:
13    print("Date not missed")