On Wed, Nov 2, 2016 at 10:36 AM, Pádraig Brady <[email protected]> wrote: > On 06/10/16 12:53, Pádraig Brady wrote: >> On 06/10/16 11:11, john woods wrote: >>> date +%YW%V gives week and year; it would be nice if date +%YQ%q could >>> return, eg 2016Q3 as having a quarters code in date would save AWKwardness >>> or shell arithmetic. >>> >>> Perhaps we could have >>> %q 1,2,3,4 >>> %Q 1st quarter; 2nd quarter; 3rd quarter; 4th quarter >>> >>> Regards ... >> >> This is one of those marginal calls. >> >> It's not that awkward to get the quarter number: $(( ($(date +%-m)-1)/3+1 )) >> But I agree it would be useful to give the number directly. >> >> Note you may want to raise your proposal with the glibc team also in their >> strftime(3) interface; coreutils is hesitant to add new % modifiers in >> date(1) without prior practice from C libraries. >> >> Note ruby uses %Q to give the number of milliseconds since epoch. >> So we might skip that? >> BTW 1 -> 1st etc. functionality might be useful to add to numfmt(1). >> >> Note perl Date::Format uses %q to give the quarter number, starting with 1 >> >> I'd be 60:40 for adding it. > > Propose patch attached, > which we can add after the corresponding gnulib patch lands.
Looks fine. Thanks!
