Skip to main content

# flake8-datetimez

A plugin for flake8 to ban the usage of unsafe naive datetime class.

## List of warnings

  • DTZ001 : The use of datetime.datetime() without tzinfo argument is not allowed.

  • DTZ002 : The use of datetime.datetime.today() is not allowed. Use datetime.datetime.now(tz=) instead.

  • DTZ003 : The use of datetime.datetime.utcnow() is not allowed. Use datetime.datetime.now(tz=) instead.

  • DTZ004 : The use of datetime.datetime.utcfromtimestamp() is not allowed. Use datetime.datetime.fromtimestamp(, tz=) instead.

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

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

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

  • DTZ011 : The use of datetime.date.today() is not allowed. Use datetime.datetime.now(tz=).date() instead.

  • DTZ012 : The use of datetime.date.fromtimestamp() is not allowed. Use datetime.datetime.fromtimestamp(, tz=).date() instead.

## Install

Install with pip

` $ pip install flake8-datetimez `

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

## License

MIT

Release files for flake8-datetimez 19.5.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flake8-datetimez 19.5.4.0
File Size Uploaded
flake8-datetimez-19.5.4.0.tar.gz 3.9 kB Details

Release files / flake8-datetimez-19.5.4.0.tar.gz

Download URL flake8-datetimez-19.5.4.0.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b929592691422f2f04fc69562009249e38e31ec5e1ef6818e55c7d8749bb2765
BLAKE2b-256 checksum
How to use checksums
d23108bd6854e60863054df9b5daf728e822f1d963616a6f47830db374c183f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

Release history Release notifications | RSS feed

26.8.1

2 release files

26.8.0

2 release files

20.6.0

2 release files

This release

19.5.4.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page