Checklist for testing date and time fields
A “pick a date” field looks innocent — but date and time fields fail more tests in production than anything else. Time zones, DST transitions, locales, leap years — every item has shot someone.
Basic cases
- Minimum and maximum allowed date (boundary values, including +1 day/second over).
- Date in the past and in the future — validates per spec?
- Current moment with millisecond precision (matters for transaction logs).
Time zones
🌍 User in UTC+3 creates an event at 23:30. Server stores it in UTC. When viewed from UTC-8 — which date shows up? Verify there’s no “day shift” bug.
🌍 IANA timezones vs offsets: Europe/Moscow and +03:00 are different things — the first accounts for historical zone changes.
🌍 Server time may be out of sync with client — NTP is sometimes disabled in production.
DST (Daylight Saving)
⚠️ On the spring-forward night in Europe, the hour 02:00–03:00 disappears — an event at 02:30 is invalid.
⚠️ On the fall-back, the hour 02:00–03:00 repeats — a cron 0 2 * * * fires twice.
⚠️ Russia hasn’t shifted clocks since 2011, but libraries handle it correctly only with up-to-date tzdata.
Formats and locales
- DD/MM/YYYY (Europe) vs MM/DD/YYYY (US) vs YYYY-MM-DD (ISO 8601). Field “01/02/2024” — is that February 1st or January 2nd?
- Localization: “May” vs “Май” vs “5月” — does the parser handle all variants?
- Two-digit year: 25 → 2025 or 1925? Java
SimpleDateFormatby default treats values >50 as 19xx.
Edge bugs
🐞 Leap years: Feb 29 2024 (exists) and 2025 (doesn’t) — both handled?
🐞 January 31 + 1 month = Feb 28/29? In JS new Date(2024,0,31).setMonth(2) returns March 2.
🐞 Y2K38: Unix timestamp 2038-01-19 03:14:07 overflows int32. If the backend uses 32-bit time_t — it’ll crash.
What to do right now
✅ Fix the time zone explicitly in test cases — “23:30 UTC” or “23:30 Europe/Moscow”, not just “23:30”.
✅ Build a parameterized test set with DST dates for your markets.
✅ Verify date display in the UI from different time zones (by mocking system time).
✅ For API contracts use only ISO 8601 with explicit offset.