Feedback
DateTime.UnixTimestamp now handles MinValue and MaxValue across timezones
- Status
- Fixed
- Fixed in
- v26.7.5
- Source discussion
- https://forum.objo.dev/d/667-crash-app-with-datetime
- Last updated
- 2026-07-25
Upvotes
0 upvotes
Uses your Objo forum account.
Public summary
Calling DateTime.UnixTimestamp on a sentinel value (DateTime.MinValue, returned by an unset DateTimePicker.DisplayDateStart, or a near-DateTime.MaxValue from DisplayDateEnd) crashed the app with an ArgumentOutOfRangeException in timezones whose offset pushes the converted UTC instant outside the representable year 1..9999 range (e.g. Europe/Paris, America/New_York). UnixTimestamp now clamps the converted instant to the representable range and returns a finite value instead of crashing.