How to Calculate the difference between two dates?

view full story

http://www.unix.com – I want the difference between two following date using scripts in terms of no.of days. How I can accomplish this. Code: lastdate=Tue Nov 13 10:30:56 2012 currdate=Wed Dec 15 15:58:21 PAKST 2012 Ouput should be like this: Code: Your Password will expire after =  32 Days on  Wed Dec 15 15:58:21 PAKST 2012 Moderator's Comments: Please use code tags next time for your code and data. (HowTos)