Skip to content

Commit

Permalink
Workaround y2k38.
Browse files Browse the repository at this point in the history
This patch fixes #388.

We now store 2035-01-01 00:00:00.

Contributors:
 * @spirillen
  • Loading branch information
funilrys committed Oct 3, 2024
1 parent 8b1177f commit 00b9202
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PyFunceble/dataset/sql_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 00b9202

Please sign in to comment.