---
source: crates/ruff_linter/src/rules/refurb/mod.rs
---
FURB162 [*] Unnecessary timezone replacement with zero offset
 --> FURB162.py:8:24
  |
6 | ### Errors
7 |
8 | datetime.fromisoformat(date.replace("Z", "+00:00"))
  |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
9 | datetime.fromisoformat(date.replace("Z", "-00:" "00"))
  |
help: Remove `.replace()` call
  |
7 |
  - datetime.fromisoformat(date.replace("Z", "+00:00"))
8 + datetime.fromisoformat(date)
9 | datetime.fromisoformat(date.replace("Z", "-00:" "00"))
  |
note: This is an unsafe fix and may change runtime behavior

FURB162 [*] Unnecessary timezone replacement with zero offset
  --> FURB162.py:9:24
   |
 8 | datetime.fromisoformat(date.replace("Z", "+00:00"))
 9 | datetime.fromisoformat(date.replace("Z", "-00:" "00"))
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10 |
11 | datetime.fromisoformat(date[:-1] + "-00")
   |
help: Remove `.replace()` call
   |
8  | datetime.fromisoformat(date.replace("Z", "+00:00"))
   - datetime.fromisoformat(date.replace("Z", "-00:" "00"))
9  + datetime.fromisoformat(date)
10 |
   |
note: This is an unsafe fix and may change runtime behavior

FURB162 [*] Unnecessary timezone replacement with zero offset
  --> FURB162.py:11:24
   |
 9 | datetime.fromisoformat(date.replace("Z", "-00:" "00"))
10 |
11 | datetime.fromisoformat(date[:-1] + "-00")
   |                        ^^^^^^^^^^^^^^^^^
12 | datetime.fromisoformat(date[:-1:] + "-0000")
   |
help: Remove `.replace()` call
   |
10 |
   - datetime.fromisoformat(date[:-1] + "-00")
11 + datetime.fromisoformat(date)
12 | datetime.fromisoformat(date[:-1:] + "-0000")
   |
note: This is an unsafe fix and may change runtime behavior

FURB162 [*] Unnecessary timezone replacement with zero offset
  --> FURB162.py:12:24
   |
11 | datetime.fromisoformat(date[:-1] + "-00")
12 | datetime.fromisoformat(date[:-1:] + "-0000")
   |                        ^^^^^^^^^^^^^^^^^^^^
13 |
14 | datetime.fromisoformat(date.strip("Z") + """+0"""
   |
help: Remove `.replace()` call
   |
11 | datetime.fromisoformat(date[:-1] + "-00")
   - datetime.fromisoformat(date[:-1:] + "-0000")
12 + datetime.fromisoformat(date)
13 |
   |
note: This is an unsafe fix and may change runtime behavior

FURB162 [*] Unnecessary timezone replacement with zero offset
  --> FURB162.py:14:24
   |
12 |   datetime.fromisoformat(date[:-1:] + "-0000")
13 |
14 |   datetime.fromisoformat(date.strip("Z") + """+0"""
   |  ________________________^
15 | |                                          """0""")
   | |________________________________________________^
16 |   datetime.fromisoformat(date.rstrip("Z") + "+\x30\60" '\u0030\N{DIGIT ZERO}')
   |
help: Remove `.replace()` call
   |
13 |
   - datetime.fromisoformat(date.strip("Z") + """+0"""
   -                                          """0""")
14 + datetime.fromisoformat(date)
15 | datetime.fromisoformat(date.rstrip("Z") + "+\x30\60" '\u0030\N{DIGIT ZERO}')
   |
note: This is an unsafe fix and may change runtime behavior

FURB162 [*] Unnecessary timezone replacement with zero offset
  --> FURB162.py:16:24
   |
14 | datetime.fromisoformat(date.strip("Z") + """+0"""
15 |                                          """0""")
16 | datetime.fromisoformat(date.rstrip("Z") + "+\x30\60" '\u0030\N{DIGIT ZERO}')
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17 |
18 | datetime.fromisoformat(
   |
help: Remove `.replace()` call
   |
15 |                                          """0""")
   - datetime.fromisoformat(date.rstrip("Z") + "+\x30\60" '\u0030\N{DIGIT ZERO}')
16 + datetime.fromisoformat(date)
17 |
   |
note: This is an unsafe fix and may change runtime behavior

FURB162 [*] Unnecessary timezone replacement with zero offset
  --> FURB162.py:20:5
   |
18 |   datetime.fromisoformat(
19 |       # Preserved
20 | /     (  # Preserved
21 | |         date
22 | |     ).replace("Z", "+00")
   | |_________________________^
23 |   )
   |
help: Remove `.replace()` call
   |
21 |         date
   -     ).replace("Z", "+00")
22 +     )
23 | )
   |
note: This is an unsafe fix and may change runtime behavior

FURB162 [*] Unnecessary timezone replacement with zero offset
  --> FURB162.py:26:5
   |
25 |   datetime.fromisoformat(
26 | /     (date
27 | |      # Preserved
28 | |     )
29 | |       .
30 | |         rstrip("Z"
31 | |                # Unsafe
32 | |                ) + "-00" # Preserved
   | |________________________^
33 |   )
   |
help: Remove `.replace()` call
   |
27 |      # Preserved
   -     )
   -       .
   -         rstrip("Z"
   -                # Unsafe
   -                ) + "-00" # Preserved
28 +     ) # Preserved
29 | )
   |
note: This is an unsafe fix and may change runtime behavior

FURB162 [*] Unnecessary timezone replacement with zero offset
  --> FURB162.py:36:5
   |
35 |   datetime.fromisoformat(
36 | /     (  # Preserved
37 | |         date
38 | |     ).strip("Z") + "+0000"
   | |__________________________^
39 |   )
   |
help: Remove `.replace()` call
   |
37 |         date
   -     ).strip("Z") + "+0000"
38 +     )
39 | )
   |
note: This is an unsafe fix and may change runtime behavior

FURB162 [*] Unnecessary timezone replacement with zero offset
  --> FURB162.py:42:5
   |
41 |   datetime.fromisoformat(
42 | /     (date
43 | |      # Preserved
44 | |     )
45 | |     [  # Unsafe
46 | |         :-1
47 | |     ] + "-00"
   | |_____________^
48 |   )
   |
help: Remove `.replace()` call
   |
44 |     )
   -     [  # Unsafe
   -         :-1
   -     ] + "-00"
45 | )
   |
note: This is an unsafe fix and may change runtime behavior

FURB162 [*] Unnecessary timezone replacement with zero offset
  --> FURB162.py:52:24
   |
51 | # Edge case
52 | datetime.fromisoformat("Z2025-01-01T00:00:00Z".strip("Z") + "+00:00")
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: Remove `.replace()` call
   |
51 | # Edge case
   - datetime.fromisoformat("Z2025-01-01T00:00:00Z".strip("Z") + "+00:00")
52 + datetime.fromisoformat("Z2025-01-01T00:00:00Z")
53 |
   |
note: This is an unsafe fix and may change runtime behavior
