Date Validation again

I want a sample Date validation script using if loops.
The script should first compare "year".If the year is lesser than the current year,It should go for "month" checking.
I have the script that splits the date into year,month and date.I want only the checking part.
My if loop checking is not work properly.
Can you show the right way of checking?

Regards
Dave:confused:

Please show us what you have so far and somebody may be able to provide a suggestion.

This is the splitting part am having:

C_Date=`date -u +%m/%d/%Y`

year="$(echo $Date | cut -d/ -f3)"
month="$(echo $Date | cut -d/ -f1)"
day="$(echo $Date | cut -d/ -f2)"

cyear="$(echo $C_Date | cut -d/ -f3)"
cmonth="$(echo $C_Date | cut -d/ -f1)" cday="$(echo $C_Date | cut -d/ -f2)"
C_Date is current date i.e Today's Date.

#Validation
if [ $year -gt $cyear ]; then
echo "Enter Valid Year"
fi
Similarly am checking for month and day.Is there any other simple way to do the comparison using case Statement?

year=2008
month=01
day=05
C_date=`date "+%C%y%m%d"`
inp_date=`echo "$year$month$day"`
if [ "$inp_date" -lt "$C_date" ]
then
echo "Input Date is less than today"
fi

Define what you mean by date checking. It has to be today's date? or is any valid date okay? ranjithpr provided a basis for comparing relative dates - dates older or younger than a given date.