Use TZ-aware timestamps

This commit is contained in:
Jeremy Stretch 2025-07-09 08:51:03 -04:00
parent ae3de95dce
commit 92a13a4226

View File

@ -3,6 +3,8 @@ import logging
from dataclasses import dataclass, field
from datetime import datetime
from django.utils import timezone
__all__ = (
'JobLogEntry',
)
@ -12,7 +14,7 @@ __all__ = (
class JobLogEntry:
level: str
message: str
timestamp: datetime = field(default_factory=datetime.now)
timestamp: datetime = field(default_factory=timezone.now)
@classmethod
def from_logrecord(cls, record: logging.LogRecord):