Skip to content

Commit

Permalink
Scripts: use datetime to get date and set timezone to UTC (#1410)
Browse files Browse the repository at this point in the history
This will ensure the package is reproducible even in different
timezones.
  • Loading branch information
charles2910 authored Nov 24, 2024
1 parent 64287ee commit 3463fc3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/gen-man.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")

Expand Down

0 comments on commit 3463fc3

Please sign in to comment.