mirror of
https://github.com/nushell/nushell.git
synced 2026-11-26 03:25:39 +08:00
## Description `date to-timezone` silently discarded trailing content and offset seconds, and accepted malformed separators such as `+05:` and `+05:::30`. Preserve optional seconds, reject non-whitespace suffixes, and allow at most one colon before the minutes, requiring minutes when that colon is present. Existing whitespace forms remain supported. This preserves offsets emitted by `into record` and `format date '%::z'`, including historical offsets used by `std-rfc`'s `date floor` and `date ceil`. Validation: 54 date command tests, 10 standard-library date tests, and 43 checks against the built macOS CLI passed. Coverage includes malformed separators, whitespace compatibility, historical Monrovia/Dublin/New York offsets, round trips, and rounding. All six new invalid-separator tests fail before the separator fix. Workspace Clippy, formatting, and spelling checks passed. ## User-facing changes (Release notes) `date to-timezone` preserves seconds in numeric offsets such as `+05:30:15` and rejects invalid suffixes and separators such as `+05:30XYZ`, `+05:`, and `+05:::30`. Historical time zones with second-level offsets round correctly with `date floor` and `date ceil`. ## Additional notes Closes #19433. --------- Co-authored-by: wangjianjun <passionworkeer@users.noreply.github.com>