From 3463fc331f2895cad7f4a1fbdb9c8186dcac6e5f Mon Sep 17 00:00:00 2001 From: Carlos Henrique Lima Melara <34252251+charles2910@users.noreply.github.com> Date: Sat, 23 Nov 2024 23:22:57 -0300 Subject: [PATCH] Scripts: use datetime to get date and set timezone to UTC (#1410) This will ensure the package is reproducible even in different timezones. --- scripts/gen-man.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/gen-man.py b/scripts/gen-man.py index def48b072..2bb589add 100755 --- a/scripts/gen-man.py +++ b/scripts/gen-man.py @@ -9,7 +9,7 @@ """ from json import load -from datetime import date +from datetime import datetime, timezone from time import time from re import search from os import environ, path @@ -36,8 +36,10 @@ titlePage = "Fastfetch man page" # date (center footer) # format : "Month (abbreviation) Day Year" -todayDate = date.fromtimestamp( - int(environ.get("SOURCE_DATE_EPOCH", time()))).strftime("%b %d %Y") +todayDate = datetime.fromtimestamp( + int(environ.get("SOURCE_DATE_EPOCH", time())), + tz=timezone.utc, +).strftime("%b %d %Y") # file to fastfetch version (left footer) pathToVersionFile = path.join(pathToCurrentDir, "../CMakeLists.txt")