Originally posted by Rob Galino
Is there a way to convert a julian date i.e. 363 to calendar date i.e. Thu Dec 29 10:57:56 HST 2005 easily in AIX? Julian date is easily provided by using "date +%j", calander date by just typing "date".
I want to be able to refer to the julian date the convert back to calendar date.
I have a cron script which does the following:
DATE=`date +%Y%m%d`
YESTERDAY=`expr $DATE - 1`
# Copy charge file to out directory...
cp $SOURCEDIR$YESTERDAY$FILENAME.* $HOMEDIR$ODIR
Well, this works well until the last day 1st of every month. I need a way to set the variable YESTERDAY to the true day before the last day of the month, i.e. if today is 20050301, YESTERDAY should be 20050228 but the current cron script sets YESTERDAY to 20050300 which is an invalid date...
Thanks all,
- Rob