date-time-timezone-testing
Skill1 starsChanged 53 days agoMITView on GitHub
Use when testing anything involving dates, times, time zones, DST, leap years/seconds, scheduling, expiry, recurring events, cron jobs, or locale calendars — with frozen clocks, boundary calendars, and the classic time bugs checklist.
In this repository98 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 42crunch-api-security-testingSkill
- a-b-testingSkill
- acceptance-testingSkill
- accessibility-testingSkill
- ai-agent-evaluationSkill
- ai-code-securitySkill
- ai-ml-testingSkill
- analytics-tracking-testingSkill
- api-testingSkill
- authn-authz-testingSkill
- autonomous-qa-orchestrationSkill
- bdd-gherkin-testingSkill
- blockchain-smart-contract-testingSkill
- bug-reportingSkill
- chaos-resilience-testingSkill
- chatbot-voice-agent-testingSkill
- cicd-testingSkill
- cli-testingSkill
- cloud-infrastructure-testingSkill
- code-coverage-analysisSkill
- compatibility-testingSkill
- compliance-testingSkill
- concurrency-race-condition-testingSkill
- configuration-feature-flag-testingSkill
- contract-testingSkill
- cross-browser-testingSkill
- database-testingSkill
- data-migration-testingSkill
- data-pipeline-etl-testingSkill
- desktop-app-testingSkill
- disaster-recovery-backup-testingSkill
- e2e-testingSkill
- email-notification-testingSkill
- event-driven-messaging-testingSkill
- exploratory-testingSkill
- flaky-test-managementSkill
- functional-testingSkill
- fuzz-testingSkill
- game-testingSkill
- graphql-testingSkill
- iac-container-security-testingSkill
- installation-upgrade-testingSkill
- integration-testingSkill
- iot-embedded-testingSkill
- llm-security-auditSkill
- llm-testingSkill
- localization-testingSkill
- manual-testingSkill
- mcp-testingSkill
- memory-leak-resource-testingSkill
- microservices-testingSkill
- mobile-testingSkill
- mutation-testingSkill
- observability-testingSkill
- payment-ecommerce-testingSkill
- performance-testingSkill
- production-monitoring-synthetic-testingSkill
- property-based-testingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
Compare instants, not strings: Use ISO-8601 with offset; avoid Date parsing of ambiguous 03/04/2026.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Date, Time & Time-Zone Testing
Time bugs are silent, seasonal and expensive. Make time an injectable dependency and test the calendar's sharp edges deliberately.
Test-date matrix (always include)
| Case | Example values |
| Leap day | 2024-02-29, 2023-02-28→03-01, 2100-02-29 invalid (century rule) |
| Month/year ends | Jan 31 + 1 month, Dec 31 23:59:59 → Jan 1, ISO week 53 |
| DST spring-forward | 2026-03-08 02:30 America/New_York (does not exist) |
| DST fall-back | 2026-11-01 01:30 (occurs twice) |
| Odd offsets | Asia/Kolkata +05:30, Asia/Kathmandu +05:45, Australia/Lord_Howe 30-min DST |
| Zone changes | user travels; server UTC vs browser local; zone rule updates (tzdata) |
| Epoch limits | 32-bit overflow 2038-01-19, negative epochs, 0 |
| Locale calendars | Buddhist/Hijri/Japanese eras, week starting Sunday vs Monday |
| Leap second | 23:59:60 tolerated by parsers |
Techniques
- Freeze the clock:
freezegun/time-machine(Py),jest.useFakeTimers().setSystemTime(),Clock.fixed()(Java),faketime/libfaketimefor binaries,TZ=Asia/Dhakaenv var. - Run the suite under multiple zones:
for tz in UTC America/Los_Angeles Asia/Kolkata Pacific/Auckland; do TZ=$tz npm test; done. - Store UTC, display local; store the zone ID (not offset) for future events (meetings, reminders).
- Compare instants, not strings. Use ISO-8601 with offset; avoid
Dateparsing of ambiguous03/04/2026. - Property test:
parse(format(t)) == tfor random instants across zones. - Scheduler tests: advance a fake clock past triggers; verify missed-run and double-run behavior across DST; cron in
UTC. - Expiry logic: assert at
expiry-1s,expiry,expiry+1s; token TTL and clock skew tolerance (±60s).
from freezegun import freeze_time
@freeze_time("2026-03-08 06:59:59", tz_offset=0) # 1s before US DST jump
def test_reminder_survives_dst(): ...Bug checklist
new Date("2026-01-31") parsed as UTC then displayed a day earlier · + 24h ≠ next day on DST · month arithmetic overflow · week-year (YYYY vs yyyy) in formatters · DB TIMESTAMP vs TIMESTAMPTZ · naive vs aware datetimes · sorting by string date · server local time in cron · "end of day" excluded from ranges.
Related
localization-testing, unit-testing, property-based-testing, database-testing
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

