Mike - EMAIL IGNORED wrote:
On Thu, 09 Aug 2007 06:02:27 +0930, Tim wrote:
Andrew Parker:
For bash the following will display 061 if its currently a leap year,
060 otherwise
date -d "$(date +%Y)/03/01" +%j
Kevin J. Cummings:
It doesn't work with dates after 2037/03/01 ....
Leaving you with thirty years to develop a solution, or spend a few
minutes pondering whether to bother... ;-)
But seriously, although some might think you don't need to worry about
such things, there are programs that will need to do some work using a
date from the future. The matter is more urgent than immediately
obvious.
[...]
My program deals only with the present and the immediate past.
Since in 30 years I hope to celebrate (?) my 98th, it would be
quite interesting to see if the problem still concerns me. :)
Mike.
In a terminal type $cal 2 2008 and you will see February has 29 days
when it is leap year according to Google. Do $cal 2 2007 and you will
see this:
[karl@k5di ~]$ cal 2 2007
February 2007
Su Mo Tu We Th Fr Sa
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28
So no leap year in 2007
--
Karl F. Larsen, AKA K5DI
Linux User
#450462 http://counter.li.org.