Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

ruff: Fix DTZ005 `datetime.datetime.now()` without `tz` argument.

Anders Kaseorgba78bee8c473
diff --git a/zilencer/management/commands/rundjangoserver.py b/zilencer/management/commands/rundjangoserver.py
index c05633e975a..084be4a6363 100644
--- a/zilencer/management/commands/rundjangoserver.py
+++ b/zilencer/management/commands/rundjangoserver.py
@@ -2,12 +2,13 @@ from datetime import datetime
from functools import wraps
from typing import Callable
+from dateutil.tz import tzlocal
from django.core.management.commands.runserver import Command as DjangoCommand
def output_styler(style_func: Callable[[str], str]) -> Callable[[str], str]:
# Might fail to suppress the date line around midnight, but, whatever.
- date_prefix = datetime.now().strftime("%B %d, %Y - ")
+ date_prefix = datetime.now(tzlocal()).strftime("%B %d, %Y - ")
@wraps(style_func)
def _wrapped_style_func(message: str) -> str: