From 981b85f2dcc7315a66ee2e5be78d0752a91fdf34 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 2 Dec 2024 08:43:22 +0100 Subject: [PATCH] Use datetime.now --- ols/app/endpoints/feedback.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ols/app/endpoints/feedback.py b/ols/app/endpoints/feedback.py index 9da929230..b520b1ba4 100644 --- a/ols/app/endpoints/feedback.py +++ b/ols/app/endpoints/feedback.py @@ -2,7 +2,7 @@ import json import logging -from datetime import datetime +from datetime import UTC, datetime from pathlib import Path from typing import Any @@ -65,7 +65,7 @@ def store_feedback(user_id: str, feedback: dict) -> None: storage_path = Path(config.ols_config.user_data_collection.feedback_storage) storage_path.mkdir(parents=True, exist_ok=True) - current_time = str(datetime.utcnow()) + current_time = str(datetime.now(tz=UTC)) data_to_store = {"user_id": user_id, "timestamp": current_time, **feedback} # stores feedback in a file under unique uuid