๐Ÿงช

Evil Test Cases

Downloadable test cases for edge cases, DST transitions, and timezone changes. Use these to torture-test your time handling code.

โšก

Quick Downloads

๐ŸŒ…

DST Transition Test Cases

Spring Forward (Non-existent Times)

These times don't exist because clocks "spring forward" at 2:00 AM to 3:00 AM.

# 2024 Spring DST Transitions (Non-existent times)
2024-03-10T02:30:00 America/New_York    # EST โ†’ EDT
2024-03-10T02:15:00 America/Chicago     # CST โ†’ CDT  
2024-03-10T02:45:00 America/Denver      # MST โ†’ MDT
2024-03-10T02:30:00 America/Los_Angeles # PST โ†’ PDT
2024-03-31T02:30:00 Europe/London       # GMT โ†’ BST
2024-03-31T02:30:00 Europe/Berlin       # CET โ†’ CEST
2024-03-31T02:30:00 Europe/Paris        # CET โ†’ CEST

Fall Back (Ambiguous Times)

These times occur twice because clocks "fall back" from 2:00 AM to 1:00 AM.

# 2024 Fall DST Transitions (Ambiguous times - occur twice)
2024-11-03T01:30:00 America/New_York    # EDT โ†’ EST (fold=0 and fold=1)
2024-11-03T01:15:00 America/Chicago     # CDT โ†’ CST
2024-11-03T01:45:00 America/Denver      # MDT โ†’ MST  
2024-11-03T01:30:00 America/Los_Angeles # PDT โ†’ PST
2024-10-27T01:30:00 Europe/London       # BST โ†’ GMT
2024-10-27T02:30:00 Europe/Berlin       # CEST โ†’ CET
2024-10-27T02:30:00 Europe/Paris        # CEST โ†’ CET
๐Ÿ“…

Leap Year Test Cases

February 29th Edge Cases

# Leap Year Tests
2024-02-29T12:00:00Z  # Valid: 2024 is a leap year
2023-02-29T12:00:00Z  # Invalid: 2023 is not a leap year
2000-02-29T12:00:00Z  # Valid: 2000 is a leap year (divisible by 400)
1900-02-29T12:00:00Z  # Invalid: 1900 is not a leap year (divisible by 100, not 400)
2100-02-29T12:00:00Z  # Invalid: 2100 is not a leap year

# Leap year arithmetic edge cases
2024-02-29T12:00:00Z + 1 year = ?  # Should become 2025-02-28T12:00:00Z
2023-02-28T12:00:00Z + 1 year = ?  # Should become 2024-02-28T12:00:00Z (not Feb 29)
โฐ

Epoch and Timestamp Test Cases

Unix Timestamp Edge Cases

# Unix Timestamp Boundaries
0                    # 1970-01-01T00:00:00Z (Unix epoch)
-1                   # 1969-12-31T23:59:59Z (before epoch)
2147483647           # 2038-01-19T03:14:07Z (32-bit signed int max)
2147483648           # 2038-01-19T03:14:08Z (32-bit overflow)
4294967295           # 2106-02-07T06:28:15Z (32-bit unsigned int max)

# Milliseconds vs Seconds confusion
1710086400           # 2024-03-10T14:00:00Z (seconds)
1710086400000        # 2024-03-10T14:00:00Z (milliseconds)
1710086400.123       # 2024-03-10T14:00:00.123Z (seconds with fractional)

# JavaScript Date edge cases
new Date(0)          # 1970-01-01T00:00:00.000Z
new Date(-1)         # 1969-12-31T23:59:59.999Z
new Date(8640000000000000)   # Maximum Date value
new Date(8640000000000001)   # Invalid Date

Y2K38 Problem Test Cases

# Y2K38 Problem (32-bit signed integer overflow)
2038-01-19T03:14:07Z  # Last valid second (2147483647)
2038-01-19T03:14:08Z  # First invalid second (2147483648)
2038-01-19T03:14:09Z  # Wraps to 1901-12-13T20:45:53Z on 32-bit systems

# Test these timestamps on 32-bit systems
2147483647           # Should work
2147483648           # May fail or wrap around
4294967295           # Definitely problematic on signed 32-bit
๐ŸŒ

Timezone Test Cases

Timezone Name Confusion

# Ambiguous timezone abbreviations
CST  # Central Standard Time (US) or China Standard Time?
IST  # India Standard Time or Israel Standard Time?
EST  # Eastern Standard Time (US) or Australian Eastern Standard Time?
PST  # Pacific Standard Time (US) or Philippine Standard Time?

# Windows vs IANA timezone names
"Pacific Standard Time"     # Windows
"America/Los_Angeles"       # IANA
"Eastern Standard Time"     # Windows  
"America/New_York"          # IANA

# Historical timezone changes
"Asia/Calcutta"            # Old name
"Asia/Kolkata"             # New name (same timezone)
"Europe/Kiev"              # Old name
"Europe/Kyiv"              # New name (same timezone)

Political Timezone Changes

# Samoa Date Line Jump (December 30, 2011 never happened)
2011-12-29T23:59:59 Pacific/Apia  # Last second of Dec 29
2011-12-31T00:00:00 Pacific/Apia  # First second of Dec 31 (skipped Dec 30)

# Russia timezone changes (2014)
2014-10-25T23:59:59 Europe/Moscow  # Before change (UTC+4)
2014-10-26T00:00:00 Europe/Moscow  # After change (UTC+3)

# Venezuela timezone change (2016)
2016-04-30T23:59:59 America/Caracas  # UTC-4:30
2016-05-01T00:00:00 America/Caracas  # UTC-4:00

# North Korea timezone change (2018)
2018-05-04T23:59:59 Asia/Pyongyang   # UTC+8:30
2018-05-05T00:00:00 Asia/Pyongyang   # UTC+9:00
๐Ÿ“

Parsing Test Cases

Malformed and Edge Case Inputs

# ISO 8601 edge cases
"2024-02-30T12:00:00Z"        # Invalid date (Feb 30)
"2024-13-01T12:00:00Z"        # Invalid month (13)
"2024-12-01T25:00:00Z"        # Invalid hour (25)
"2024-12-01T12:60:00Z"        # Invalid minute (60)
"2024-12-01T12:00:60Z"        # Invalid second (60)

# Timezone offset edge cases
"2024-12-01T12:00:00+25:00"   # Invalid offset (>24 hours)
"2024-12-01T12:00:00-15:00"   # Invalid offset (<-12 hours)
"2024-12-01T12:00:00+00:60"   # Invalid minute offset

# Ambiguous formats
"01/02/2024"                  # Jan 2 or Feb 1?
"2024/1/2"                    # Jan 2 or Feb 1?
"2024-1-2"                    # Missing zero padding

# Leap second (not supported by most systems)
"2016-12-31T23:59:60Z"        # Leap second

# Empty and null cases
""                            # Empty string
null                          # Null value
undefined                     # Undefined value
"not a date"                  # Random string
๐Ÿ“–

How to Use These Test Cases

Unit Testing

  • โ€ข Use non-existent times to test error handling
  • โ€ข Test ambiguous times with both fold values
  • โ€ข Verify leap year calculations
  • โ€ข Test timestamp boundary conditions
  • โ€ข Validate timezone conversion accuracy

Integration Testing

  • โ€ข Test API endpoints with edge case inputs
  • โ€ข Verify database storage and retrieval
  • โ€ข Test timezone-aware scheduling
  • โ€ข Validate user input parsing
  • โ€ข Test cross-system time synchronization
๐Ÿ”—

Related Resources

Testing Tools

Documentation