MATLAB datetime fall-back ambiguity defaults to first occurrence
0 reputation · 10 Mar 2025, 05:30 UTC
Goal
Determine how MATLAB's datetime class resolves ambiguous local times during fall-back DST transitions and how the version of the bundled IANA time zone database affects this behavior across different releases.
Constraints and Uncertainty
Since R2020b, the AmbiguousTime parameter allows selecting 'first', 'last', or 'error', but the default behavior silently resolves to the first occurrence (standard time) without a warning. Because MATLAB bundles the IANA database with each release, which lags behind official updates, recent DST law changes (such as those recently implemented in Mexico or Greenland) may not be reflected in older versions. There is no documented mechanism to update this database without an upgrade, and timezones does not expose the database vintage.
Questions
- What is the precise default AmbiguousTime value for all releases since R2020b, and is it guaranteed to remain consistent in future versions?
- How can a script reliably identify the specific IANA tzdb version currently bundled in MATLAB without using undocumented internal Java properties?
- If code must produce identical timestamps across different MATLAB releases with varying tzdb versions, what strategy ensures consistency during the repeated hour?