Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to compare current date to future date pythono

import datetime

CurrentDate = datetime.datetime.now()
print(CurrentDate)

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

if CurrentDate > ExpectedDate:
    print("Date missed")
else:
    print("Date not missed")
Comment

PREVIOUS NEXT
Code Example
Python :: python thread with parameters 
Python :: python tkinter quit button 
Python :: __name__== __main__ in python 
Python :: cprofile implementation 
Python :: how to import subprocess in python 
Python :: createview django 
Python :: print() in python 
Python :: django queryset unique values 
Python :: default argument in flask route 
Python :: read only the first line python 
Python :: printing with format float to 2 decimal places python 
Python :: requests session in python 
Python :: how to say hello world in python 
Python :: print complete dataframe pandas 
Python :: How to set up flash message in html template in flask app 
Python :: urlencode python 
Python :: open text with utf-8 
Python :: add headers tp requests python 
Python :: find python path cmd 
Python :: python enumerate start at 1 
Python :: find rows in dataframe from another dataframe python 
Python :: pd merge on multiple columns 
Python :: amazon response 503 python 
Python :: swapcase 
Python :: pandas shift columns up until value 
Python :: binary string to hex python 
Python :: make calculator in python 
Python :: bot ping discord.py 
Python :: python get day month year 
Python :: execute command in python script 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =