Skip to main content

Plugin to check that utcnow() is not used in favour of now(UTC)

Project description



Plugin for flake8 to warn the developer of the usage of datetime.utcnow().

The problem with datetme.utcnow() is that indeed returns the current timestamp in the UTC timzone but the object is a naive datetime, that is doesn't have the tzinfo argument set.

Instead [](] shoukd be used passing the UTC timezone:

from datetime import datetime, timezone


To install the plugin and flake8:

pip install flake8_datetime_utcnow_plugin

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8_datetime_utcnow_plugin-0.1.1.tar.gz (2.5 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page