Skip to content

Commit

Permalink
Merge pull request #318 from HebaruSan/fix/closer-tz
Browse files Browse the repository at this point in the history
Fix timezone problem in ticket closer
  • Loading branch information
HebaruSan authored Nov 13, 2023
2 parents 7d58417 + 9c84062 commit d09c4a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions netkan/netkan/ticket_closer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone
from importlib.resources import read_text
from collections import defaultdict
from string import Template
Expand All @@ -18,7 +18,7 @@ def __init__(self, token: str, user_name: str) -> None:
self._user_name = user_name

def close_tickets(self, days_limit: int = 7) -> None:
date_cutoff = datetime.now() - timedelta(days=days_limit)
date_cutoff = datetime.now(timezone.utc) - timedelta(days=days_limit)

for repo_name in self.REPO_NAMES:
repo = self._gh.get_repo(f'{self._user_name}/{repo_name}')
Expand Down

0 comments on commit d09c4a1

Please sign in to comment.