Is this Year a Leap Year? (using Shell Script Commands)

This page answers questions like these:


Related Links:
What Day of the Week Was It?
Yesterday's Date using Shell Script Commands
Tomorrow's Date using Shell Script Commands



Is this Year a Leap Year?

if date -d "29 feb" >/dev/null 2>&1 then echo "Yes, this year is a leap year." else echo "No, this year is a not leap year." fi

Is a Given Year a Leap Year?

if date -d "29 feb YYYY" >/dev/null 2>&1 then echo "Yes, YYYY is a leap year." else echo "No, YYYY is a not leap year." fi


Related Links:
What Day of the Week Was It?
Yesterday's Date using Shell Script Commands
Tomorrow's Date using Shell Script Commands

Home  >  Linux / Unix  >  Is this Year a Leap Year? (using Shell Script Commands)


Tags: leap year, date, shell script, shell command, linux, unix, solaris, bsd, aix

Copyright © HelpDoco.com
date-leap-years.txt
Linux-Unix/is-this-year-a-leap-year-using-shell-script-commands.htm
2