diff --git a/scripts/sourceversion.py b/scripts/sourceversion.py index a7c526c4c863..b838d70708c8 100644 --- a/scripts/sourceversion.py +++ b/scripts/sourceversion.py @@ -1,19 +1,18 @@ import subprocess import sys -from datetime import datetime, timezone, timedelta +from datetime import datetime, timezone -def get_time_in_timezone(timezone_offset): +def get_time_in_timezone(zone: str = "Europe/Bratislava"): try: from zoneinfo import ZoneInfo - my_tz = ZoneInfo("Europe/Bratislava") + my_tz = ZoneInfo(zone) except Exception as e: my_tz = timezone.utc return datetime.now(my_tz) if __name__ == '__main__': - cet_offset = 1 - ts = get_time_in_timezone(cet_offset) + ts = get_time_in_timezone() print(f"This info was generated on: {ts.strftime('%Y-%m-%d %H:%M:%S %Z%z')}") cmd = 'git log -1 --pretty=format:"Git hash: %H Date of commit: %ai"'