days are between the two dates?

I have two times in the format of YYMMDD. Does anyone know an easy way in ksh for me to display how many days are between the two dates?

Example1:
X=101202
Y=101205
There are 3 days between X & Y

Example2:
X=101202
Y=111202
There are 365 days between X & Y

Example3:
X=101205
Y=101202
There are -3 days between X & Y

If you searched a bit better this forum, you would have found:
http://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html

See if this works in your ksh (ksh-only):

echo "There are $(( ( $(printf "%(%s)T" 20$Y) - $(printf "%(%s)T" 20$X) ) /3600/24  )) days between X & Y"

Thanks I figured it out. What I really needed was just to determine if a license was about to expire. So I did the following:

FUTURE_DATE=`TZ=GMT-60 date +%y%m%d%H%M%S`
if [[ ${VALID_TO_DATE} -lt ${FUTURE_DATE} ]]