-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
date.exe -u argument doesn't work. #6396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I decided to take a look at this - it seems like the following logic needs to be updated: coreutils/src/uu/date/src/date.rs Lines 214 to 246 in 8cac375
The math up to this point is still using Local::now() (thus current_time still being a Local::now()). I'm thinking that the return value down below should use the
Which changes the string representation of the date to be offset by Would like someone to check this (since is my first look at the repo) - can make a PR if is accurate. Edit: Probably also would need a new test added, since |
I think this was fixed in #6503 Test as bellow after that meger: # GNU date
➜ date -u -d "@1715372666" +"%F, %T %Z%z"
2024-05-10, 20:24:26 UTC+0000
➜ date -d "@1715372666" +"%F, %T %Z%z"
2024-05-11, 04:24:26 CST+0800
# uu_date
➜ cargo r -p uu_date -- -u -d "@1715372666" +"%F, %T %Z%z"
2024-05-10, 20:24:26 +00:00+0000
➜ cargo r -p uu_date -- -d "@1715372666" +"%F, %T %Z%z"
2024-05-11, 04:24:26 +08:00+0800 |
Fixed, thank you! |
Uh oh!
There was an error while loading. Please reload this page.
Hi, I think I've found a bug using the -u argument with date.exe. When is used with the GnuWin32 version it shows:
date.exe -u -d "@1715372666" +"%F, %T %Z%z"
2024-05-10, 20:24:26 UTC+0000
And when is not used:
date.exe -d "@1715372666" +"%F, %T %Z%z"
2024-05-10, 21:24:26 Hora de verano GMT+0100
But with coreutils, with or without the -u, it always shows the same time:
coreutils date -d "@1715372666" +"%F, %T %Z%z"
2024-05-10, 20:24:26 +01:00+0100
Here without the -u should be one hour more (21:24:26), and when used it should show +0000.
Cheers.
The text was updated successfully, but these errors were encountered: