LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-29-2008, 10:14 AM   #1
tmaxx
LQ Newbie
 
Registered: Jun 2006
Posts: 21

Rep: Reputation: 15
computing time duration


hi can anyone help on a script which computes time duration:

given:

a. database archive update time = 15:25
b. current system = 17:15

b-a=duration

thanks in advance
 
Old 04-29-2008, 08:37 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
This should really be in the prog forum.

You could write a script in bash, eg cvt hrs to mins, calc total time, then subtract results in mins.
To get hrs

echo "17:15"|cut -d':' -f1
17
mins=$((17 * 60))
1020

etc

Get started and come back to us if you get stuck.
Here's a some good refs:
http://www.tldp.org/LDP/abs/html/
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://rute.2038bug.com/index.html.gz
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
are duration of rhce courses is enough? Barq Linux - Certification 1 02-06-2008 07:04 AM
Duration of backscatter billymayday Linux - Security 9 01-20-2007 05:47 AM
LXer: Quantum computing billions of times faster than conventional computing LXer Syndicated Linux News 0 11-24-2006 02:21 AM
Start Date + Time Duration = End Date/Time calculator? ToBe Linux - General 3 09-26-2005 10:17 AM
KInternet - Connection duration RogerW Linux - Newbie 0 04-16-2005 02:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration