Return to Snippet

Revision: 36838
at November 28, 2010 00:27 by magicrebirth


Initial Code
from datetime import datetime, timedelta

now = datetime.now()
sometime_in_the_future = datetime(2020, 1, 1, now.hour, now.minute, now.second)
MAX_AGE = timedelta(hours=2, minutes=0)
if (now - sometime_in_the_future) > MAX_AGE:
	return True
else:
	return False

Initial URL

                                

Initial Description

                                

Initial Title
Check time difference between now and specified time

Initial Tags

                                

Initial Language
Python