bug-gnulib
[Top][All Lists]
Advanced

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

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


From: Pádraig Brady
Subject: Re: [PATCH] support for quarter from strftime (%q)
Date: Sat, 5 Nov 2016 16:59:04 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

On 02/11/16 15:25, Pádraig Brady 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
> 
>> 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.

I proposed this for glibc with little push back,
and the only significant suggestion to add to strptime()
also for consistency.  Therefore I did that in the attached,
added a test, and pushed.


thanks,
Pádraig.

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


reply via email to

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