math question! - calculate time

Sidle up to the bar (Lightly Moderated)

Moderator: Dictators in Training

math question! - calculate time

Postby Naethyn » Thu Jun 01, 2006 4:15 pm

Anyone know a formula to calculate total amount of time elapsed?

Say its 09:03am and you want to find out how long of a time passed at 4:57pm.

It seems like an easy question and maybe a full day of work has shut my brain down but I can't think on a formula to calculate it.

I'm not looking for the answer but how you arrived at the answer!
User avatar
Naethyn
NT Traveller
NT Traveller
 
Posts: 2085
Joined: Wed May 04, 2005 12:13 pm

Postby Ganzo » Thu Jun 01, 2006 4:28 pm

millitary time.
4:57pm = 16,57
09:03am = 9,03

16,57 - 9.03 = 7,54

elapsed time is 7 hrs and 54 min

:dunno:
גם זה יעבור

Narrock wrote:Yup, I ... was just trolling.

Narrock wrote:I wikipedia'd everything first.
User avatar
Ganzo
Dictator in Training
Dictator in Training
 
Posts: 2648
Joined: Thu Mar 18, 2004 9:05 pm

Postby Phlegm » Thu Jun 01, 2006 4:50 pm

Ganzo wrote:millitary time.
4:57pm = 16,57
09:03am = 9,03

16,57 - 9.03 = 7,54

elapsed time is 7 hrs and 54 min

:dunno:



not alway correct since time is base 60 not base 10.
Last edited by Phlegm on Thu Jun 01, 2006 5:25 pm, edited 1 time in total.
Phlegm
Nappy Headed Ho
Nappy Headed Ho
 
Posts: 6258
Joined: Tue Aug 03, 2004 5:50 pm

Postby Dylan » Thu Jun 01, 2006 4:52 pm

Buy a watch.
Dylan
NT Patron
NT Patron
 
Posts: 5229
Joined: Mon Mar 15, 2004 11:11 am
Location: Seattle

Postby Gidan » Thu Jun 01, 2006 5:43 pm

Convert to military time first

Next convert both times into minutes
Start Time in Minutes = Start Hour * 60 + Start Minute
End Time in Minutes = End Hour * 60 + End Minute

Get the Difference between the 2
If Start Time in Minutes > End Time in Minutes
Total difference in minutes = 1440 - Start Time in Minutes + End Time in Minutes
If End Time in Minutes > or = Start Time in Minutes
Total difference in minutes = End Time in Minutes - Start Time in Minutes

Determin the number of minutes passed
Total Minutes passed = Total Difference in Minutes MOD 60

Determin the number of hours passed
Total Hours passed = Total Difference in Minutes DIV 60

Your elapsed time
Total Elapsed time = Total Hours Passed : Total Minutes Passed


Its not quick but it will give you the time your looking for. Its the easiest way to deal with the minutes.
For to win one hundred victories in one hundred battles is not the acme of skill. To subdue the enemy without fighting is the acme of skill.
User avatar
Gidan
Admin Abuse Squad
Admin Abuse Squad
 
Posts: 2892
Joined: Tue Jan 04, 2005 11:01 am

Postby Phlegm » Thu Jun 01, 2006 6:03 pm

The easiest way to find the time is by adding instead of subtracting.

For instance: time elapsed between 3:48 am and 7:25 pm:

12 minutes to 4 am.
15 hours between 4 am to 7 pm.
25 minutes between 7 pm to 7:25 pm.

add them up 15 hrs+25minutes+12 minutes = 15:37 is the time elapsed.

By adding you don't have to worry about the converting.
Phlegm
Nappy Headed Ho
Nappy Headed Ho
 
Posts: 6258
Joined: Tue Aug 03, 2004 5:50 pm

Postby brinstar » Fri Jun 02, 2006 1:42 am

math :-x
compost the rich
User avatar
brinstar
Cat Crew
Cat Crew
 
Posts: 13142
Joined: Tue Mar 09, 2004 1:45 pm
Location: 402

Postby Griever » Fri Jun 02, 2006 5:23 am

brinstar wrote:math :-x
Griever
NT Veteran
NT Veteran
 
Posts: 1283
Joined: Fri Apr 02, 2004 8:34 am
Location: Northern Virginia

Postby Granh » Fri Jun 02, 2006 8:39 am

? = ((AE+12)-AS)
AE = Absolute End
AS = Absolute Start

Convert the minutes to an absolute by dividing them by 60. This will return a number easier to work with.

I.E.
9:03 would convert to 9.05 (3 divide 60 = 0.05)
4:57 would convert to 4.95 (57 divide 60 = 0.95)

If you take these numbers and this formula you can find the absolute difference.

? = ((4.95+12)-9.05)

? = 7.9

Take the decimal and convert it back by multiplying 60 by the decimal in % form.

0.9 = 90% (60*90%=54)

Elapsed Time = 7:54

Example was easier done with just military but if end minutes is less than start minutes this is faster.

9:47am to 8:12pm?

? = ((8.2+12)-9.78)
? = 10.42
Elapsed Time = 10:25
Kitty Litter for the Mind
Granh
NT Froglok
NT Froglok
 
Posts: 184
Joined: Fri Mar 12, 2004 1:57 pm
Location: Dallas, TX

Postby Phlegm » Fri Jun 02, 2006 12:01 pm

I think my way is still faster.
Phlegm
Nappy Headed Ho
Nappy Headed Ho
 
Posts: 6258
Joined: Tue Aug 03, 2004 5:50 pm


Return to Cap's Alehouse

Who is online

Users browsing this forum: No registered users and 23 guests

cron