-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
Description
The -u flag doesn't work correctly for:
- Pure digit strings (e.g.,
date -u -d "12") --referenceoption--resolutionoption
Output shows local timezone instead of UTC.
Reproduction
Run in non-UTC timezone:
# Bug #1: Pure digits
$ date -u -d "12" "+%Z"
BST # Expected: UTC
# Bug #2: --reference
$ touch /tmp/testfile
$ date -u --reference /tmp/testfile "+%Z"
BST # Expected: UTC
# Bug #3: --resolution
$ date -u --resolution "+%Z"
BST # Expected: UTCCause
src/uu/date/src/date.rs:
- Line 279:
--referencealways usesTimeZone::try_system() - Line 285:
--resolutionalways usesTimeZone::system() - Line 461:
parse_date()ignores timezone offset in parsed string
None check the settings.utc flag.
Reactions are currently unavailable