From 00b92027ebd422daa6aedc496d05734a903d6d1e Mon Sep 17 00:00:00 2001 From: funilrys Date: Thu, 3 Oct 2024 15:41:04 +0200 Subject: [PATCH] Workaround y2k38. This patch fixes #388. We now store 2035-01-01 00:00:00. Contributors: * @spirillen --- PyFunceble/dataset/sql_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyFunceble/dataset/sql_base.py b/PyFunceble/dataset/sql_base.py index 671c96fe..ba0edf96 100644 --- a/PyFunceble/dataset/sql_base.py +++ b/PyFunceble/dataset/sql_base.py @@ -305,7 +305,7 @@ def add(self, row) -> "SQLDBDatasetBase": if "expiration_date" not in row and "epoch" not in row: raise exception - y2k38_limit = datetime(2037, 12, 31, 0, 0) + y2k38_limit = datetime(2035, 12, 31, 0, 0) new_date = datetime.fromtimestamp(float(row["epoch"]), timezone.utc) new_date -= new_date - y2k38_limit