SaaS Trial Billed a Day Early Due to Inconsistent Date Conventions
A customer who signed up for a 14-day trial on March 1, 2026 was charged at 00:00 UTC on March 15, which was still March 14 in New York. The developer who inherited the billing code found that three parts of the codebase used different conventions for counting days, and none had been documented. The core issue was whether the trial interval included its endpoints, since the customer counted signup day as day 1 while the system treated the trial as a half-open interval. Testing showed that daylight saving time shifts can make naive timezone-aware subtraction return inaccurate results, so timestamps must be converted to UTC before calculating durations. The company refunded the customer and adopted a written convention: intervals are half-open everywhere, the inclusive day count applies only to reports, and timezones are normalized before any subtraction.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in