agentleFS
mejbaurbaharmejbaurbahar/software-tester-skills/skills/date-time-timezone-testing/SKILL.md

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.

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
  1. Very specific:

    Compare instants, not strings: Use ISO-8601 with offset; avoid Date parsing of ambiguous 03/04/2026.

    line 32

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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)

CaseExample values
Leap day2024-02-29, 2023-02-28→03-01, 2100-02-29 invalid (century rule)
Month/year endsJan 31 + 1 month, Dec 31 23:59:59 → Jan 1, ISO week 53
DST spring-forward2026-03-08 02:30 America/New_York (does not exist)
DST fall-back2026-11-01 01:30 (occurs twice)
Odd offsetsAsia/Kolkata +05:30, Asia/Kathmandu +05:45, Australia/Lord_Howe 30-min DST
Zone changesuser travels; server UTC vs browser local; zone rule updates (tzdata)
Epoch limits32-bit overflow 2038-01-19, negative epochs, 0
Locale calendarsBuddhist/Hijri/Japanese eras, week starting Sunday vs Monday
Leap second23:59:60 tolerated by parsers

Techniques

  1. Freeze the clock: freezegun/time-machine (Py), jest.useFakeTimers().setSystemTime(), Clock.fixed() (Java), faketime/libfaketime for binaries, TZ=Asia/Dhaka env var.
  2. Run the suite under multiple zones: for tz in UTC America/Los_Angeles Asia/Kolkata Pacific/Auckland; do TZ=$tz npm test; done.
  3. Store UTC, display local; store the zone ID (not offset) for future events (meetings, reminders).
  4. Compare instants, not strings. Use ISO-8601 with offset; avoid Date parsing of ambiguous 03/04/2026.
  5. Property test: parse(format(t)) == t for random instants across zones.
  6. Scheduler tests: advance a fake clock past triggers; verify missed-run and double-run behavior across DST; cron in UTC.
  7. 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.