-
Testing
Test my date and timezone logic around the edges
Cover the date math that breaks in production: DST, month boundaries, user timezones, and 'end of day' calculations.
Free Prompt
Date and time bugs survive development because everything looks fine in one timezone. I want tests for the edges.
Find the date-sensitive logic in my app: trial periods, billing cycles, subscription renewals, scheduling features, 'X days ago' displays, date range filters, expirations of any kind. List what you find.
Then write tests covering the known failure modes:
1. Timezone boundaries: a user in a different timezone than the server sees dates on the correct day (a trial ending 'March 15' doesn't end on March 14 for them).
2. Daylight saving transitions: durations that span a DST change are still correct (a 30-day trial is 30 days, not 29 days 23 hours).
3. Month and year boundaries: monthly billing or reports behave correctly on the 31st, in February, and across New Year's.
4. Expiration comparisons: 'is this expired' checks compare in the same timezone on both sides, and expire at the intended instant (start of day vs end of day matters).
5. Storage: dates are stored in a consistent, unambiguous format (UTC or with explicit offsets), not server-local time. If they're stored in local time, flag it as a finding.
Use controlled clocks or injected 'now' values so these tests are deterministic. A test that only fails on March 31st is worse than no test.
When finished, run the suite and report which date behaviors are verified and where you found actual bugs.
What This Does / How This Helps
This tests your date and timezone logic at the edges: DST transitions, month boundaries, cross-timezone users, and expiration comparisons. Date bugs are cron jobs that fire wrong, trials that end a day early for Australian users, and renewals that bill on the wrong date. They pass all development testing because your machine and your test data share a timezone, then surface in production as billing disputes and support tickets you can't reproduce locally. Controlled-clock tests make them reproducible and fixable.
Want to skip doing this by hand?
Fortivibe audits your app for all of the areas these prompts cover (and more).