On 28/02/02 16:34 -0800, PJN wrote:
> >On 28/02/02 02:01 -0800, rocky g wrote:
> >> I am writing a shell script which does billing on time
> >> basis and i need to add the following
<snip>
> I wonder if I'm mistaken or you are ... i don't think rocky's 
> problem is getting the time in that format, which is very easy
> if you look at 'man date'
> I think his problem is in finding the difference between the two
> in hours, minutes and seconds.
In that case, man cut :)
Or use Perl -MDate::Calc :)
Nasty way:
hh=cut -f 1 -d ':' time1
let hh=$hh+`cut -f 1 -d ':' time2`
Repeat for mm and ss
total_time=$hh:$mm:ss

Devdas Bhagat

_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to