diff --git a/services/npmplus.py b/services/npmplus.py index 828ae0b..6418ed9 100644 --- a/services/npmplus.py +++ b/services/npmplus.py @@ -14,8 +14,12 @@ def _parse_expiry(value: str | None) -> datetime | None: cleaned = value.strip() try: if cleaned.endswith("Z"): - return datetime.fromisoformat(cleaned.replace("Z", "+00:00")) - return datetime.fromisoformat(cleaned) + dt = datetime.fromisoformat(cleaned.replace("Z", "+00:00")) + else: + dt = datetime.fromisoformat(cleaned) + if dt.tzinfo is None: + dt = dt.replace(tzinfo=timezone.utc) + return dt except ValueError: for fmt in ("%Y-%m-%d %H:%M:%S", "%Y-%m-%d"): try: