DateTime.fromFormat on the DST switch day
Author: john30Created Mar 30, 2026Updated Apr 16, 2026
Labelsfuture plansv4
Describe the bug Using DateTime.fromFormat('02:30', 'hh:mm') returns an unexpectedly valid result even if it is not when doing it on the day of DST change (2026-03-29 in Europe e.g.) for a time to parse that just doesn't exist. Instead it silently shifts the hour by the difference of the zone offset.
To Reproduce DateTime.fromFormat('02:30', 'hh:mm').isValid returns true when executed in Europe/Berlin timezone on 2026-03-29. DateTime.fromFormat('02:30', 'hh:mm').hour returns 3
Actual vs Expected behavior DateTime.fromFormat('02:30', 'hh:mm').isValid should return false when executed in Europe/Berlin timezone on 2026-03-29.
Desktop (please complete the following information):
- OS: Ubuntu 24.04
- Browser: irrelevant
- Luxon version: 3.7.2
- Your timezone: Europe/Berlin
Additional context nothing to add here
Source: moment/luxon