Skip to content

Commit

Permalink
Do not remove timezone when incrementing month in _get_next_dt
Browse files Browse the repository at this point in the history
  • Loading branch information
iamlikeme committed Nov 30, 2023
1 parent a1cfa3e commit 4a0e151
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arq/cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def _get_next_dt(dt_: datetime, options: Options) -> Optional[datetime]: # noqa
micro = max(dt_.microsecond - options.microsecond, 0)
if field == 'month':
if dt_.month == 12:
return datetime(dt_.year + 1, 1, 1)
return datetime(dt_.year + 1, 1, 1, tzinfo=dt_.tzinfo)
else:
return datetime(dt_.year, dt_.month + 1, 1)
return datetime(dt_.year, dt_.month + 1, 1, tzinfo=dt_.tzinfo)
elif field in ('day', 'weekday'):
return (
dt_
Expand Down

0 comments on commit 4a0e151

Please sign in to comment.