to find the diff in a date

Hello,

i have a variable where the present date is going to save.
and i have another variable where the another date which will of higher value is going to save.

I need to find the difference with respect to date,month and year.
What the need is to send an e-mail if the difference in dates is more than 25 days to a perticular team.

Requesting for assistance...

Thanks
Nag

You might want to convert both dates to epoch time (seconds since 01.01.1970) and then compare if the difference is greater than 60*60*24*25 seconds.
There are various ways to convert using for example a perl module, date -d if your date command supports this or strftime in gawk.

Try googling for "convert date epoch shell" where shell can be exchanged to your type of shell or awk/gawk or perl or...
There is also a lot of questions and answers on date arithmetics in this forum here. You might want to use the search function.

I'll change your subject since it is a bit confusing.

Hi,

This sort of question crops up a lot, and there are a number of posts on this already.

I think you should find what you're looking for in the FAQ article:

http://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html

HTH