Skip to content

Commit

Permalink
Don't use datetime.utcnow() (deprecated).
Browse files Browse the repository at this point in the history
  • Loading branch information
smurfix committed Oct 11, 2024
1 parent fbd0197 commit e8b8dcb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion caldav/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class hierarchy into a separate file)
from datetime import datetime
from datetime import timedelta
from datetime import timezone
from datetime import UTC
from typing import Any
from typing import List
from typing import Optional
Expand Down Expand Up @@ -2999,7 +3000,7 @@ def complete(
* safe - see doc for _complete_recurring_safe for details
"""
if not completion_timestamp:
completion_timestamp = datetime.utcnow().astimezone(timezone.utc)
completion_timestamp = datetime.now(UTC)

if "RRULE" in self.icalendar_component and handle_rrule:
return getattr(self, "_complete_recurring_%s" % rrule_mode)(
Expand Down

0 comments on commit e8b8dcb

Please sign in to comment.