On hardware like the Raspberry Pi there is no battery back clock so the OS has to get the DateTime via NTP.

Simple invalid value check

from datetime import datetime

    if (datetime.now().year >= 2025):       #This catches, 1970-01-01, 2000-01-01, basically any power-up default clock (not perfect but commonly used in embedded systems)
        return True