Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jm committed Aug 27, 2024
1 parent 855fa65 commit 6d9c8b1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scripts/sourceversion.py
Original file line number Diff line number Diff line change
@@ -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"'
Expand Down

0 comments on commit 6d9c8b1

Please sign in to comment.