diff --git a/app/scodoc/sco_utils.py b/app/scodoc/sco_utils.py index af69a970..6d25e0d4 100644 --- a/app/scodoc/sco_utils.py +++ b/app/scodoc/sco_utils.py @@ -50,6 +50,7 @@ import numpy as np from PIL import Image as PILImage import pydot import requests +from pytz import timezone import dateutil.parser as dtparser import flask @@ -220,12 +221,7 @@ def localize_datetime(date: datetime.datetime or str) -> datetime.datetime: date = is_iso_formated(date, convert=True) new_date: datetime.datetime = date - if date is not None and date.tzinfo is None: - # TOTALK: Paramètre scodoc pour avoir la timezone du serveur/ timezone paramétrée - time_zone: datetime.timezone = datetime.timezone( - datetime.timedelta(seconds=3600), "default" - ) - new_date = date.replace(tzinfo=time_zone) + new_date = timezone("Europe/Paris").localize(date) return new_date