Sadler:
I've seen scripts that jumped thru mighty hoopes trying to solve datetime problems like yours. If you can, I'd look at the GNU versions of awk and date. Here's a gawk function I acquired:
#!/bin/sh
# time.sh
# Author: Julian Cates
#
# Figure what a date was/will be, given an offset
# from current day:
#./time.sh -7
# Thu May 17 10:49:06 CDT 2001
#==========================================================
ME=`basename ${0}`
if [ $# -ne 1 ]
then echo "Usage is $ME [+/-] # of days"
else
/usr/local/gnu/bin/gawk -v days=$1 'BEGIN{
target_date = systime()+(86400*days)
datestring = strftime("%c", target_date)
printf "%s\n\n",datestring }'
fi
If you're up for Perl, you might check out Mike Lacey's most excellent FAQ at:
faq80-953
in the General Unix forum.
Regards,
Ed