bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] support for quarter from strftime (%q)


From: Pádraig Brady
Subject: [PATCH] support for quarter from strftime (%q)
Date: Wed, 2 Nov 2016 15:25:20 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

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

> 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 perl Date::Format uses %q to give the quarter number, starting with 1

Attached in the gnulib portion.

I'll suggest for inclusion to glibc also.

thanks,
Pádraig

Attachment: strftime-%q.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]