Re: It it now a leap year?

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

 



Mike - EMAIL IGNORED 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?

Probably lots of ways in lots of languages, but just for kicks (should be all on one line):

perl -MDate::Calc -e "print Date::Calc::leap_year((localtime())[5]+1900)?'Leap year':'Not leap year'"

This uses the Date::Calc module in Perl which does loads of nice date calculations and manipulations. You can install this with

yum install perl-Date-Calc

and then 'man Date::Calc' to see the documentation.

Simon.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux