Skip to content

Commit

Permalink
fix: make time now tz aware
Browse files Browse the repository at this point in the history
Signed-off-by: Zack Koppert <[email protected]>
  • Loading branch information
zkoppert committed May 24, 2023
1 parent 3e3fc49 commit 868ef4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stale_repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
""" Find stale repositories in a GitHub organization. """

import os
from datetime import datetime
from datetime import datetime, timezone
from os.path import dirname, join

import github3
Expand Down Expand Up @@ -72,7 +72,7 @@ def print_inactive_repos(github_connection, inactive_days_threshold, organizatio
if last_push_str is None:
continue
last_push = parse(last_push_str)
days_inactive = (datetime.now() - last_push).days
days_inactive = (datetime.now(timezone.utc) - last_push).days
if days_inactive > int(inactive_days_threshold):
inactive_repos.append((repo, days_inactive))
print(f"{repo.html_url}: {days_inactive} days inactive") # type: ignore
Expand Down

0 comments on commit 868ef4c

Please sign in to comment.