It it now a leap year?

Alan Cox alan at lxorguk.ukuu.org.uk
Wed Aug 8 23:19:42 UTC 2007


On Wed, 08 Aug 2007 16:26:19 -0400
"Kevin J. Cummings" <cummings at kjchome.homeip.net> wrote:

> Andrew Parker wrote:
> > On 8/8/07, Mike - EMAIL IGNORED <m_d_berger_1900 at yahoo.com> wrote:
> >> Is there a system call or variable that will
> >> tell me if it is now a leap year, or should I
> >> do the arithmetic?
> > 
> > For bash the following will display 061 if its currently a leap year,
> > 060 otherwise
> > 
> > date -d "$(date +%Y)/03/01" +%j
> 
> It doesn't work with dates after 2037/03/01 ....

It does on a 64bit machine 8)




More information about the fedora-list mailing list