-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
date: --date
always results in invalid date
#2685
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
It currently uses date --date="1970-01-01T00:00:00Z"
date --date="1970-01-01T00:00:00+01:00" (It doesn't seem to do anything with the timezone afterwards, though.) |
Ah, okay! Thanks for the info. For others with a problem similar to mine: if you need to convert a unix epoch to retrieve the time between two moments, something like the following works good. date --date="$(TZ=Etc/GMT printf '1970-01-01%(T%H:%M:%S)T+00:00\n' 12345)" -u +%H:%M Specifically, I needed this to make this polybar script work. |
Any trick for having relative dates? (E.g: all the ones visible here: https://www.cyberciti.biz/tips/linux-unix-get-yesterdays-tomorrows-date.html) |
I can't find any relative date support in the code, but it's definitely something we should support, so feel free to open an issue for it! |
also treated in uutils#2685 and uutils#3463 Signed-off-by: Lucas Larson <LucasLarson@riseup.net>
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
From the two original examples one has been fixed in the meantime:
The other example still fails:
|
As the title says, everything I tried to pass to the
--date
option results in invalid date.I am currently using the version
0.0.7
on NixOS 20.05.Also, thanks for all your work!
The text was updated successfully, but these errors were encountered: