Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Anyone got a script to calc date differences

Status
Not open for further replies.

Tison

Programmer
May 12, 1999
216
CH
I wonder if anyone has a clever script which will calculate the difference between 2 dates ?
ie. Date 1 : Mon 26 10:11:22
Date 2 ; Tue 27 11:23:01
How do I find the total number of minutes between these two ?
 
Can the date output format be changed or is this set?
 
date %d
will give you the 'days' which can subtract without worry of months and days in month
something like:(im not at a aix box to test syntax)
echo $(($(date d%)-$DATE1*1440)) #DATE1-then from now

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top