Number of days between two distinct dates

Hi

I'm looking for a .ksh script/function that will calculate ONLY the number of days between two distinct dates. Further convert the number of days to weeks and display. I need this to be part of another larger script that checks the password expiry on several servers and notifies the administrator about ageing passwords.

Can someone please provide me with a plugin function/script that i could use for this purpose.

fyi, i reviewed the datecalc script but it does not serve my purpose entirely. Much obliged to anyone who can help...

Regards
Radheymohan

i suggest you convert both dates to Julian dates (the number of days since January 1, 4713 B.C), subtract larger number from smaller number and divide by 7.

Here is a pointer to an article which may help:

http://www.samag.com/documents/s=9370/sam0307b/0307b.htm