mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-22 19:32:24 +01:00
Enable DTZ004: use datetime.fromtimestamp with UTC timezone
This commit is contained in:
parent
5a24296c8e
commit
b828c5de80
@ -97,8 +97,8 @@ def run_bot(log_level: str = "INFO", decline_correspondence: bool = False) -> No
|
|||||||
"createdAtDate"
|
"createdAtDate"
|
||||||
)
|
)
|
||||||
if created_ms:
|
if created_ms:
|
||||||
game_date_iso = datetime.datetime.utcfromtimestamp(
|
game_date_iso = datetime.datetime.fromtimestamp(
|
||||||
int(created_ms) / 1000
|
int(created_ms) / 1000, tz=datetime.timezone.utc
|
||||||
).strftime("%Y.%m.%d")
|
).strftime("%Y.%m.%d")
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@ -66,7 +66,6 @@ ignore = [
|
|||||||
"S110", # try-except-pass - common pattern in scripts
|
"S110", # try-except-pass - common pattern in scripts
|
||||||
"S112", # try-except-continue - acceptable pattern
|
"S112", # try-except-continue - acceptable pattern
|
||||||
"DTZ005", # datetime.now without tz - acceptable for local scripts
|
"DTZ005", # datetime.now without tz - acceptable for local scripts
|
||||||
"DTZ004", # datetime.utcfromtimestamp - acceptable
|
|
||||||
"PERF401", # manual-list-comprehension - style preference
|
"PERF401", # manual-list-comprehension - style preference
|
||||||
"RUF005", # collection-literal-concatenation - style preference
|
"RUF005", # collection-literal-concatenation - style preference
|
||||||
"SIM102", # collapsible-if - style preference
|
"SIM102", # collapsible-if - style preference
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user