Menu

Days Between Dates: Why Our 14-Day Trial Charged Users a Day Early
πŸ“°

Days Between Dates: Why Our 14-Day Trial Charged Users a Day Early

DEV Community: backendΒ·meng mengΒ·7 days ago
#VbMEGGMP
#devtobackend#devto#dev#days#datetime
Reading 0:00
15s threshold

Last February I inherited the billing code for a small SaaS. The marketing page promises a 14-day trial. A customer signed up on March 1, 2026, and her card got hit at 00:00 UTC on March 15 β€” which was 7 p.m. on March 14 in New York. Her ticket said, in full: "I counted. Day 14 was yesterday."

She was right. Our trial gate treated the trial as the half-open interval [signup, signup + 14 days), expiring at March 15 00:00 UTC. She counted the way humans do: signup day is day 1, so her day 14 was March 14. Both readings are defensible. The real bug was that three parts of our codebase picked different conventions and nobody had written one down.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.