Standard library only · runs in your browser
Your stage 1 suite is green and the code ships. Two weeks later, three support tickets say the bot refused refunds on day 30. The code does exactly what everyone agreed. The agreement was missing a word.
The tickets:
The shop stores every timestamp in UTC, and the agent counted days between the UTC dates. The owner confirms what "30 days" meant all along: calendar days on the customer's own calendar.
Fix local_days_between(delivered_at, requested_at, tz_offset_hours). It returns the number of calendar days between the two moments, counted on the customer's local calendar. Timestamps are ISO strings ending in Z. The offset is in hours and can be fractional (5.5 for India).
local_days_between(delivered_at: str, requested_at: str, tz_offset_hours: float) -> int