Skip to content

Commit ab67d89

Browse files
committed
Add timezone arg to cutoff date
1 parent d984f82 commit ab67d89

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def pick_pet(pets):
104104
# Add pet ID to list of posted pets
105105
data["posted_pets"].append({"name": selected_pet.name, "pet_id": selected_pet.pet_id, "time": datetime.now(timezone.utc).isoformat()})
106106
# Remove old pets
107-
cutoff = datetime.now() - timedelta(weeks=12)
107+
cutoff = datetime.now(timezone.utc) - timedelta(weeks=12)
108108
new_pets = [item for item in data["posted_pets"] if datetime.fromisoformat(item['time']) > cutoff]
109109
data["posted_pets"] = new_pets
110110
# Export json

0 commit comments

Comments
 (0)