-
Notifications
You must be signed in to change notification settings - Fork 546
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
GNU coreutils date
-like time zone formatting
#759
Conversation
Would you mind documenting in the PR description the intended behavior? |
@jarkonik ping ? :) |
I've expanded the PR description a bit. If more information is needed please let me know what should I change/add. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable. Some minor suggestions below.
Thanks, this looks good to me. |
@esheppa any opinions? |
Looks good, just one thing I'd noticed is that potentially it could loop forever if the input was like My concern with the looping forever is that the strftime items can be used to validate user input, so it could be a DOS attack |
remove match option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jarkonik, if possible, do you mind making a couple of fixes in the docs?
Thanks! |
Well done! |
Pull request adds additional string formatting options for time zones using multiple colons as syntax, which are identical to formatting options in GNU coreutils
date
( https://man7.org/linux/man-pages/man1/date.1.html )This would fix uutils/coreutils#3780
The pull request adds additional format specifiers for
chrono::format::strftime
.In addition to currently implemented
%z
and%:z
PR adds 2 new time zone formatting identifiers:%::z
-Offset from the local time to UTC with seconds.Example output:
+09:30:00
%:::z
- Offset from the local time to UTC without minutes.Example output:
+09