Dear all,
Today=`date +%d%m%y``
I want to decrease the date by 1. How would we do that.
Thanks.
Dear all,
Today=`date +%d%m%y``
I want to decrease the date by 1. How would we do that.
Thanks.
Have a look at the FAQ here
does not help that much,
can u tell me some other easier way out.
thanks
By 2 what? day? month? year?
Have you read the FAQ encrypted told you? It's full of examples that I do think will help you...
something like this?
7daysbefor=$( date -d "-7days" +%Y-%m-%d)
yesterday=$( date -d "-1days" +%Y-%m-%d)
tomorrow=$( date -d "1days" +%Y-%m-%d)
in7days=$( date -d "7days" +%Y-%m-%d)
I can decrease the date by 1 for you, but...you must supply 5 lbs of plutonium for the flux capacitor.

if you just want to roll back 1 day: for HP or solaris:
TZ=aaa24
on Solaris you can give it more than 24 hrs, HP that's are far as you can go
with this date hack. Other brands of UNIX unsure if this would work, but suspect it will.
best way: 86400 is # seconds in 24 hrs.
perl -e 'print localtime(time() - 86400) . "\n" '