Metadata-Version: 2.1
Name: flake8-datetime-utcnow-plugin
Version: 0.1.2.dev1
Summary: Plugin to check that utcnow() is not used in favour of now(UTC)
Home-page: https://github.com/expobrain/flake8-datetime-utcnow-plugin
License: MIT
Author: Daniele Esposti
Author-email: daniele.esposti@gmail.com
Requires-Python: >=3.7,<4
Classifier: Environment :: Console
Classifier: Framework :: Flake8
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Dist: flake8 (>=3.0.0)
Project-URL: Repository, https://github.com/expobrain/flake8-datetime-utcnow-plugin
Description-Content-Type: text/markdown

# flake8_datetime_utcnow_plugin

## Rationale

Plugin for `flake8` to warn the developer of the usage of [datetime.utcnow()](https://docs.python.org/3/library/datetime.html#datetime.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 [datetime.now()](https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow] should be used passing the UTC timezone:

```python
from datetime import datetime, timezone

datetime.now(timezone.utc)
```

## Installation

To install the plugin and `flake8`:

```
pip install flake8_datetime_utcnow_plugin
```

