from datetime import datetime, timedelta if (datetime.utcnow() - last_updated) > timedelta(1): # more than 24 hours passed