Skip to main content

A plugin for flake8 to ban naive datetime classes.

Project description

# flake8-datetimez

Check for python unsafe naive datetime module usages.

## List of warnings

DTZ001: The use of datetime.datetime.utcnow() is not allowed.

DTZ002: The use of datetime.datetime.utcfromtimestamp() is not allowed.

DTZ003: The use of datetime.datetime.now() without tz argument is not allowed.

DTZ004: The use of datetime.datetime.fromtimestamp() without tz argument is not allowed.

DTZ005: The use of datetime.datetime.strptime() must be followed by .replace(tzinfo=)

## Install

Install with pip

` $ pip install flake8-datetimez `

## Requirements - Python 3.6 or above - flake8 3.0.0 or above

## License

MIT

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-datetimez-19.4.4.0.tar.gz (2.9 kB view hashes)

Uploaded Source

Supported by

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