how can i use mathematic calculate in date?
how can i use mathematic calculate in date?
hi all,
all i need to do is
calculate the system date to my desire date.
my case is
everyday in my system , it will receive ftp file from another unix server.
if i issued 'date' for today it will return this :
-bash-3.00$ date +%y%m%d
20070605
but the ftp file that receive everyday is like this
birth_20070604.dat
see?
because this ftp file is less than today for 1 day.
i want to use this file to process to another job to execute this file .
so,i want to minus 1 day from system date that i got from 'date' function
btw,i use solaris 10
when i use date -d
it said somethings like
illegal option -d
thank you very much in advance
........................................................................................
sorry let me change my question
after i look backward through these forums
i found that they have some kind of this
date_stamp=`tz=cst+24 date +%y%m%d`
echo $date_stamp
20070604
so i can get a yesterday date already
but another problem is
a year format
i want to convert christian era to buddhist era
that means
if i want to convert by mathematic
i need to +543 from current christian era
eg. if want to change to buddhist era,i need to plus 543 to 2007
so, the buddhist era of this year is 2007+543 = 2550
last edited by guitaroa47 : 1 week ago at 05:21 am.
|