---
source: crates/ruff_linter/src/rules/pyupgrade/mod.rs
---
UP017 [*] Use `datetime.UTC` alias
  --> UP017.py:10:11
   |
 8 |     from datetime import timezone
 9 |
10 |     print(timezone.utc)
   |           ^^^^^^^^^^^^
   |
help: Convert to `datetime.UTC` alias
   |
1  + from datetime import UTC
2  | def func():
--------------------------------------------------------------------------------
10 |
   -     print(timezone.utc)
11 +     print(UTC)
12 |
   |

UP017 [*] Use `datetime.UTC` alias
  --> UP017.py:16:11
   |
14 |     from datetime import timezone as tz
15 |
16 |     print(tz.utc)
   |           ^^^^^^
   |
help: Convert to `datetime.UTC` alias
   |
1  + from datetime import UTC
2  | def func():
--------------------------------------------------------------------------------
16 |
   -     print(tz.utc)
17 +     print(UTC)
18 |
   |

UP017 [*] Use `datetime.UTC` alias
  --> UP017.py:22:11
   |
20 |     import datetime
21 |
22 |     print(datetime.timezone.utc)
   |           ^^^^^^^^^^^^^^^^^^^^^
   |
help: Convert to `datetime.UTC` alias
   |
21 |
   -     print(datetime.timezone.utc)
22 +     print(datetime.UTC)
23 |
   |

UP017 [*] Use `datetime.UTC` alias
  --> UP017.py:28:11
   |
26 |     import datetime as dt
27 |
28 |     print(dt.timezone.utc)
   |           ^^^^^^^^^^^^^^^
   |
help: Convert to `datetime.UTC` alias
   |
27 |
   -     print(dt.timezone.utc)
28 +     print(dt.UTC)
29 |
   |

UP017 [*] Use `datetime.UTC` alias
  --> UP017.py:35:9
   |
34 |       print((
35 | /         datetime
36 | |         .timezone  # text
37 | |         .utc
   | |____________^
38 |       ))
   |
help: Convert to `datetime.UTC` alias
   |
34 |     print((
   -         datetime
   -         .timezone  # text
   -         .utc
35 +         datetime.UTC
36 |     ))
   |
note: This is an unsafe fix and may change runtime behavior
