How to perform arithmetic operation on date

Hi all,

I would appreciate if anyone knows how to perform adding to date.
As for normal date, i can easily plus with any number.
But when it comes to month end say for example 28 Jun, i need to perform a plus with number 3, it will not return 1 Jul.

Thanks in advance for your help.

hi,

u can try the following...

expr `date +%d` + 3

subhendu

That specifically does not solve the problem of wrapping at end of month. The FAQ section has a good thread on date arithmetic; see that instead. http://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html

Try:

Use date -d as shown below:

simply change TZ to change date..