DATE002warningPro

naive-datetime

Creating datetime without timezone information.

Applies to: Python

Why this matters

Naive datetimes (without timezone) cause bugs when your app runs in different timezones or when comparing times. Always use timezone-aware datetimes. Use datetime.now(timezone.utc) or datetime(..., tzinfo=timezone.utc).

Catch it before it ships

pip install stablestack # or: npx stablestackstablestack # scans your project, DATE002 includedstablestack explain DATE002

DATE002 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.

False positive in your codebase? Suppress a single line with # noqa: DATE002