---
source: crates/ruff_linter/src/rules/flake8_datetimez/mod.rs
---
DTZ005 `datetime.datetime.now()` called without a `tz` argument
 --> DTZ005.py:4:1
  |
3 | # no args
4 | datetime.datetime.now()
  | ^^^^^^^^^^^^^^^^^^^^^^^
5 |
6 | # wrong keywords
  |
help: Pass a `datetime.timezone` object to the `tz` parameter

DTZ005 `datetime.datetime.now()` called without a `tz` argument
 --> DTZ005.py:7:1
  |
6 | # wrong keywords
7 | datetime.datetime.now(bad=datetime.timezone.utc)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 |
9 | # none args
  |
help: Pass a `datetime.timezone` object to the `tz` parameter

DTZ005 `tz=None` passed to `datetime.datetime.now()`
  --> DTZ005.py:10:1
   |
 9 | # none args
10 | datetime.datetime.now(None)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 |
12 | # none keywords
   |
help: Pass a `datetime.timezone` object to the `tz` parameter

DTZ005 `tz=None` passed to `datetime.datetime.now()`
  --> DTZ005.py:13:1
   |
12 | # none keywords
13 | datetime.datetime.now(tz=None)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14 |
15 | from datetime import datetime
   |
help: Pass a `datetime.timezone` object to the `tz` parameter

DTZ005 `datetime.datetime.now()` called without a `tz` argument
  --> DTZ005.py:18:1
   |
17 | # no args unqualified
18 | datetime.now()
   | ^^^^^^^^^^^^^^
19 |
20 | # uses `astimezone` method
   |
help: Pass a `datetime.timezone` object to the `tz` parameter

DTZ005 `datetime.datetime.now()` called without a `tz` argument
  --> DTZ005.py:28:1
   |
27 | ## Errors
28 | datetime.now().replace.astimezone()
   | ^^^^^^^^^^^^^^
29 | datetime.now().replace[0].astimezone()
30 | datetime.now()().astimezone()
   |
help: Pass a `datetime.timezone` object to the `tz` parameter

DTZ005 `datetime.datetime.now()` called without a `tz` argument
  --> DTZ005.py:29:1
   |
27 | ## Errors
28 | datetime.now().replace.astimezone()
29 | datetime.now().replace[0].astimezone()
   | ^^^^^^^^^^^^^^
30 | datetime.now()().astimezone()
31 | datetime.now().replace(datetime.now()).astimezone()
   |
help: Pass a `datetime.timezone` object to the `tz` parameter

DTZ005 `datetime.datetime.now()` called without a `tz` argument
  --> DTZ005.py:30:1
   |
28 | datetime.now().replace.astimezone()
29 | datetime.now().replace[0].astimezone()
30 | datetime.now()().astimezone()
   | ^^^^^^^^^^^^^^
31 | datetime.now().replace(datetime.now()).astimezone()
   |
help: Pass a `datetime.timezone` object to the `tz` parameter

DTZ005 `datetime.datetime.now()` called without a `tz` argument
  --> DTZ005.py:31:24
   |
29 | datetime.now().replace[0].astimezone()
30 | datetime.now()().astimezone()
31 | datetime.now().replace(datetime.now()).astimezone()
   |                        ^^^^^^^^^^^^^^
32 |
33 | foo.replace(datetime.now().replace).astimezone()
   |
help: Pass a `datetime.timezone` object to the `tz` parameter

DTZ005 `datetime.datetime.now()` called without a `tz` argument
  --> DTZ005.py:33:13
   |
31 | datetime.now().replace(datetime.now()).astimezone()
32 |
33 | foo.replace(datetime.now().replace).astimezone()
   |             ^^^^^^^^^^^^^^
34 |
35 | ## No errors
   |
help: Pass a `datetime.timezone` object to the `tz` parameter
