MONTHDATE(){ # MONTHDATE nDays [format]
typeset -i nDays=$1; format=$2
typeset -i localOffset=$(echo $TZ |
sed 's![^-0-9]*\([-0-9]*\).*!\1!')
TZ=X$((localOffset-24*nDays)) date $format
}
MONTHS_DATE="$(MONTHDATE -45 '+m%d')"
Error:----
It is returning this value where as I am expecting it as YYYYMMDD format...
MONTHS_DATE=m15
Some one please help me.
typeset -i nDays=$1; format=$2
typeset -i localOffset=$(echo $TZ |
sed 's![^-0-9]*\([-0-9]*\).*!\1!')
TZ=X$((localOffset-24*nDays)) date $format
}
MONTHS_DATE="$(MONTHDATE -45 '+m%d')"
Error:----
It is returning this value where as I am expecting it as YYYYMMDD format...
MONTHS_DATE=m15
Some one please help me.