Skip to content

Python code snippet – How to compare current date to future date o?

import datetime

CurrentDate =

ExpectedDate = "9/8/2015 4:00"
ExpectedDate = datetime.datetime.strptime(ExpectedDate, "%d/%m/%Y %H:%M")

if CurrentDate > ExpectedDate:
    print("Date missed")
    print("Date not missed")
See also  Python code snippet - How to get dummies in a dataframe pandas?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.