/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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