Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Date calculations with stock and Gnu versions of 'date'' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Date calculations with stock and Gnu versions of 'date'
Authored by: S Barman on Jul 25, '08 08:56:23PM
To use the above, if you want to create a shell variable to test whether it is a leap year, you can use:
leap=$((`date -v3m -v1d -v-1d +'%d'`-28))
You can then check the variable $leap. If it is one (1), then it is a leap year! Enjoy. Scott

[ Reply to This | # ]