Difference in day-hours-minutes-seconds format

Hi experts,

I am reading two log files and passing dates as output to a txt file.
Code is given below:

echo "Start Time:" >> Report.txt
cat start.log | while read LINE1
do
echo $DATE1 >> Report.txt
done
echo "End Time:" >> Report.txt
cat end.log | while read LINE2
do
echo $DATE2 >> Report.txt
done

The out put:
Start Time:
Tue, Feb 19, 2008 08:00:02 PM
End Time:
Wed, Feb 20, 2008 02:19:09 AM

Now I want to print the overall time difference between the first output (ie $LINE1) and second output (ie $LINE2)in day-hours-minutes-seconds format.

I read the FAQs on subtracting dates, but couldnt find a method to subtract two dates in the above format.

Thanks in advance.
Sree

you haven't found an answer here ?

I use HP -UX and date -d doesnt work:confused:

What about datecalc ?

hi vino,

Can you please help me in understanding how datecalc can be made usefull for this particular issue(to input date which is of the format day ,month date ,year , hours minutes seconds AM/PM)?

Did you manage to copy datecalc script to your machine ?
There is a self explainable documentation in that script.
Just type 'datecalc -help'.

Hi Mani,

I am having datecalc.sh in my system.
But its throwing me the following error while i try "Wed, Feb 20, 2008 02:19:09 AM" as in put.
"Wed: Not an editor command"

Please help me in understanding utilizing this script to input characters such as "Wed","Tue"

Thanks in advance,
Sree

Looks very similar to Time Between Dates

Closing this thread.