Skip to content

Commit

Permalink
Simplify code for getting current timezone; fix timestamp format
Browse files Browse the repository at this point in the history
  • Loading branch information
iarspider committed Nov 13, 2024
1 parent 3024162 commit eaef742
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion github_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ def get_org_package_version(org, package, version_id, package_type="container",
def get_commits(repository, branch, until, per_page=1):
get_gh_token(repository)
if isinstance(until, datetime.datetime):
until = until.replace(microsecond=0).isoformat() + "Z"
until = until.replace(microsecond=0).isoformat().replace("+00:00", "Z")

data = github_api(
"/repos/%s/commits" % repository,
Expand Down
6 changes: 2 additions & 4 deletions ib-create-tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@
def currenttz():
if time.daylight:
return datetime.timezone(datetime.timedelta(seconds=-time.altzone), time.tzname[1])
else:
return datetime.timezone(datetime.timedelta(seconds=-time.timezone), time.tzname[0])
tm = time.localtime()
return datetime.timezone(datetime.timedelta(seconds=tm.tm_gmtoff), tm.tm_zone)
if __name__ == "__main__":
Expand Down

0 comments on commit eaef742

Please sign in to comment.