Calculating time
Discussion
Why does this trouble computers?
Google will find you a calculator for pretty much anything. Mortgage calculators, inflation calculators, half-life calculators, there's a calculator for everything.
But not time.
There are very basic ones. Add or subtract hours, mins and seconds. But nothing that will touch days too. And multiplication and division seem completely alien.
So why is it so difficult?
Google will find you a calculator for pretty much anything. Mortgage calculators, inflation calculators, half-life calculators, there's a calculator for everything.
But not time.
There are very basic ones. Add or subtract hours, mins and seconds. But nothing that will touch days too. And multiplication and division seem completely alien.
So why is it so difficult?
http://www.csgnetwork.com/timeconv.html
That one seems to do days as well as hours, minutes and seconds, but still doesn't do multiplication or division.
That one seems to do days as well as hours, minutes and seconds, but still doesn't do multiplication or division.
Turbodiesel1690 said:
Clearly google don't offer such a calculator because they know the end is nigh, what with all the unexplained bird and fish kills and the completely fecked up world weather, they probably reckon the 4 horsemen of the apocalypse are saddling up as we speak
Now that you mention it, i was thinking of the end 21/12/2012 but could it actually be 2011 as the calendar only counts in years but in actual fact 2012 is 2011. The end is truley nigh, head for the hills.
cal72 said:
Turbodiesel1690 said:
Clearly google don't offer such a calculator because they know the end is nigh, what with all the unexplained bird and fish kills and the completely fecked up world weather, they probably reckon the 4 horsemen of the apocalypse are saddling up as we speak
Now that you mention it, i was thinking of the end 21/12/2012 but could it actually be 2011 as the calendar only counts in years but in actual fact 2012 is 2011. The end is truley nigh, head for the hills.
Edited by Bebee on Thursday 13th January 10:40
plasticpig said:
pugwash4x4 said:
excel can calculat time quite happily
To a point. If you want to find the number of yoctoseconds between two dates and times it's pretty useless without some programming.Sour Kraut said:
Why does this trouble computers?
Google will find you a calculator for pretty much anything. Mortgage calculators, inflation calculators, half-life calculators, there's a calculator for everything.
But not time.
There are very basic ones. Add or subtract hours, mins and seconds. But nothing that will touch days too. And multiplication and division seem completely alien.
So why is it so difficult?
Second result on Google.Google will find you a calculator for pretty much anything. Mortgage calculators, inflation calculators, half-life calculators, there's a calculator for everything.
But not time.
There are very basic ones. Add or subtract hours, mins and seconds. But nothing that will touch days too. And multiplication and division seem completely alien.
So why is it so difficult?
http://www.timeanddate.com/date/timeduration.html
Why would you want to multiply dates?
onlynik said:
Sour Kraut said:
Why does this trouble computers?
Google will find you a calculator for pretty much anything. Mortgage calculators, inflation calculators, half-life calculators, there's a calculator for everything.
But not time.
There are very basic ones. Add or subtract hours, mins and seconds. But nothing that will touch days too. And multiplication and division seem completely alien.
So why is it so difficult?
Second result on Google.Google will find you a calculator for pretty much anything. Mortgage calculators, inflation calculators, half-life calculators, there's a calculator for everything.
But not time.
There are very basic ones. Add or subtract hours, mins and seconds. But nothing that will touch days too. And multiplication and division seem completely alien.
So why is it so difficult?
http://www.timeanddate.com/date/timeduration.html
Why would you want to multiply dates?
e.g. 94 days divided by 7 hours 24 minutes. Or 7 hours 36 minutes multiplied by 29.
You should be able to di it with a mix of the tools on www.onlineconversion.com
1) Convert dates to UNIX time (milliseconds).
2) Convert number of days/hours/minutes/seconds to millisecond).
3) A (+-/*) B
4) Convert from milliseconds to days/hours/minutes/seconds or from UNIX time to clock-time.
For your example of 94 days divided by 7 hours 24 minutes
94 days => 8121600000 ms
7 hours => 25200000 ms + 24 minutes => 1440000 ms => 26640000 ms
8121600000 / 26640000 => 304.86
1) Convert dates to UNIX time (milliseconds).
2) Convert number of days/hours/minutes/seconds to millisecond).
3) A (+-/*) B
4) Convert from milliseconds to days/hours/minutes/seconds or from UNIX time to clock-time.
For your example of 94 days divided by 7 hours 24 minutes
94 days => 8121600000 ms
7 hours => 25200000 ms + 24 minutes => 1440000 ms => 26640000 ms
8121600000 / 26640000 => 304.86
Edited by //j17 on Thursday 13th January 12:11
Sour Kraut said:
I wouldn't want to use dates, that's the point. Just units of time.
e.g. 94 days divided by 7 hours 24 minutes. Or 7 hours 36 minutes multiplied by 29.
Well, this depends on the output format you require?e.g. 94 days divided by 7 hours 24 minutes. Or 7 hours 36 minutes multiplied by 29.
Years, months, days, hours, minutes, seconds, miliseconds, nanoseconds.
And then there's the way this information is displayed. Colons, full stops?
What determines a day? A work day, 24 hour day?
Effectively you're requesting multiple calculations. You would like to know days (integers) divided by hours (decimals) or in the example you have given, something else (as .36 doesn't represent 36 mins).
So you'll need to know the calculation for hh:mm or hh:mm:ss into days, and then divide the original format by this calculation.
Result: Nobody can really be arsed I guess, but it's not much work.
Sour Kraut said:
plasticpig said:
pugwash4x4 said:
excel can calculat time quite happily
To a point. If you want to find the number of yoctoseconds between two dates and times it's pretty useless without some programming.=94/"07:24"
in a cell, make sure the cell is formatted as a number, and it gives the answer as 304.86. Excel handles dates very well for most people's
requirements, but few people know how to use it.
Mike...
If you're on Windows, open a PowerShell window and type something like this:
(get-date "20-oct-2010") - (get-date "18-mar-2009")
What you get is (almost) all the detail you need. A quick Google will help you format it into what ever format you need.
The next question people ask is 'can it tell me how many years+months+days are represented by 581 days?' This cannot be answered directly as the number is different depending on how many 28, 29, 30 and 31 day months are within this range.
The problem arises because by this point the program has discarded the start date information. When you subtract integers (whole numbers) you get another integer as the result. When you subtract dates you get a TimeSpan result (not another date). The mathematics is like this:
Date1 + TimeSpan1 = Date2
A TimeSpan has no intrinsic start value and hence cannot be formatted to years+months+days. If it contained a start date it would make the above equation confusing. If you design you TimeSpan object to store years+months+days instead of total days then the basic rules of addition fail. How do you add 1 month to 31-jan-2011?
(get-date "20-oct-2010") - (get-date "18-mar-2009")
What you get is (almost) all the detail you need. A quick Google will help you format it into what ever format you need.
The next question people ask is 'can it tell me how many years+months+days are represented by 581 days?' This cannot be answered directly as the number is different depending on how many 28, 29, 30 and 31 day months are within this range.
The problem arises because by this point the program has discarded the start date information. When you subtract integers (whole numbers) you get another integer as the result. When you subtract dates you get a TimeSpan result (not another date). The mathematics is like this:
Date1 + TimeSpan1 = Date2
A TimeSpan has no intrinsic start value and hence cannot be formatted to years+months+days. If it contained a start date it would make the above equation confusing. If you design you TimeSpan object to store years+months+days instead of total days then the basic rules of addition fail. How do you add 1 month to 31-jan-2011?
//j17 said:
You should be able to di it with a mix of the tools on www.onlineconversion.com
1) Convert dates to UNIX time (milliseconds).
2) Convert number of days/hours/minutes/seconds to millisecond).
3) A (+-/*) B
4) Convert from milliseconds to days/hours/minutes/seconds or from UNIX time to clock-time.
For your example of 94 days divided by 7 hours 24 minutes
94 days => 8121600000 ms
7 hours => 25200000 ms + 24 minutes => 1440000 ms => 26640000 ms
8121600000 / 26640000 => 304.86
You don't need to go down to milliseconds, just the lowest type, in this case minutes.1) Convert dates to UNIX time (milliseconds).
2) Convert number of days/hours/minutes/seconds to millisecond).
3) A (+-/*) B
4) Convert from milliseconds to days/hours/minutes/seconds or from UNIX time to clock-time.
For your example of 94 days divided by 7 hours 24 minutes
94 days => 8121600000 ms
7 hours => 25200000 ms + 24 minutes => 1440000 ms => 26640000 ms
8121600000 / 26640000 => 304.86
94*24(hours)*60(minutes) = 135360
/
so 7 hours (7*60 = 420) and 24 minutes = 444
=
304.86 minutes
Or as I did it in spotlight 94*24*60/444
Simples 
Then you can turn those minutes into hours so 304.86 / 60 = 5.1 hours.
Edited by Dracoro on Thursday 13th January 19:11
Dracoro said:
//j17 said:
You should be able to di it with a mix of the tools on www.onlineconversion.com
1) Convert dates to UNIX time (milliseconds).
2) Convert number of days/hours/minutes/seconds to millisecond).
3) A (+-/*) B
4) Convert from milliseconds to days/hours/minutes/seconds or from UNIX time to clock-time.
For your example of 94 days divided by 7 hours 24 minutes
94 days => 8121600000 ms
7 hours => 25200000 ms + 24 minutes => 1440000 ms => 26640000 ms
8121600000 / 26640000 => 304.86
You don't need to go down to milliseconds, just the lowest type, in this case minutes.1) Convert dates to UNIX time (milliseconds).
2) Convert number of days/hours/minutes/seconds to millisecond).
3) A (+-/*) B
4) Convert from milliseconds to days/hours/minutes/seconds or from UNIX time to clock-time.
For your example of 94 days divided by 7 hours 24 minutes
94 days => 8121600000 ms
7 hours => 25200000 ms + 24 minutes => 1440000 ms => 26640000 ms
8121600000 / 26640000 => 304.86
94*24(hours)*60(minutes) = 135360
/
so 7 hours (7*60 = 420) and 24 minutes = 444
=
304.86 minutes
Or as I did it in spotlight 94*24*60/444
Simples 
Then you can turn those minutes into hours so 304.86 / 60 = 5.1 hours.
Really?
Without using a calculator, there are about 3 'lots of' 7h24m in a day, so the answer is c.3x94.
Which is c.282.
And there's no applicable unit, surely? It's just a multiplier.
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


