GNU coreutils `date`-like time zone formatting
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 https://github.com/uutils/coreutils/issues/3780
In addition to currently implemented %z and %:z PR adds 2 new date formatting options:
%::z Offset from the local time to UTC with seconds. (+09:30:00 )
%:::z Offset from the local time to UTC without minutes. (+09)
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.
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 %:::::::::: ...etc. I've set up a PR to @jarkonik which proposes two alternative implementations (one is commented out) - https://github.com/jarkonik/chrono/pull/1
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
Thanks!
Well done! Sorry for the question but how often do you release ? :)