Switch to UTC timestamps, output in local time

This commit is contained in:
2026-01-22 23:56:07 +01:00
parent 9c7f4dfd1a
commit 9f75e5e66b
5 changed files with 23 additions and 16 deletions

View File

@@ -2,9 +2,10 @@
import logging
import threading
from datetime import datetime, timedelta
from . import utc_now
from .models import Hostname, User
from datetime import timedelta
def cleanup_expired(app):
@@ -17,7 +18,7 @@ def cleanup_expired(app):
Returns:
Number of expired hostnames processed.
"""
now = datetime.now(datetime.timezone.utc)
now = utc_now()
expired_count = 0
for hostname in Hostname.select().join(User).where(