Get Previous date of a past date

Hi all,
I have a variable where it has a past date value in the format YYYY-MM-DD

eg->
pcontromModate="2008-11-31"

How can i get the date 1 day before the pcontromModate.

The required date is 2008-11-30. ..Plz reply since its an urgent one

Please look here:

http://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html

I think I remember you asking this question before. Here is the exact shell script, maybe this will help. This is a slight modification of one of the solution from the above post. Credit goes to the original author of the code, I just made slight modification.

#!/bin/sh
pcontromModate="2008-11-31"
YEAR=`echo $pcontromModate|cut -d "-" -f 1`
MONTH=`echo $pcontromModate|cut -d "-" -f 2`
DAY=`echo $pcontromModate|cut -d "-" -f 3`
DAY=`expr "$DAY" - 1`
case "$DAY" in
        0)
           MONTH=`expr "$MONTH" - 1`
                case "$MONTH" in
                        0)
                           MONTH=12
                           YEAR=`expr "$YEAR" - 1`
                        ;;
                esac
        DAY=`cal $MONTH $YEAR | grep . | fmt -1 | tail -1`
esac
echo "Yesterday was: $MONTH-$DAY-$YEAR"

here is the output from the above:

# /tmp/45.sh
Yesterday was: 11-30-2008

What will be the output if pcontromModate is "2008-05-05" .Will it print in date format