Do you know a command or shell script to sum hours:minutes:seconds?
I have a scientific calculator that has a [NICE] button which deals with time. "Time", for it, is a unlimited number of hours (or degrees, if you prefer), number of minutes and number of seconds. It works like this:
We type number of hours (not limited to 24 or 360). Nothing new here. After that, we may type "[NICE], number of minutes, [NICE]". This will make the number of hours (a real) be increased with the right fractional part. For example: "8 [NICE] 30 [NICE]" gives the result 8.5, which means 8 and half hours. Good? After that, we may follow with "number of seconds, [NICE]", which will work similarly to what was done for the minutes we typed. For example: "8 [NICE] 30 [NICE] 900 [NICE]" gives the result of 8.75. Observe that 900 seconds is 0.25 hours, which was added to our previous result. For any real number, we may check what it represents in [HOURS/DEGREES]:MINUTES:SECONDS. For example: Make 8.75 be the current number, in any way. Then we type "[shift] [NICE]" to get "8 o 45 o 0". My "o" here is the closest I could type to what my calc shows, which is an "o" at half line height. But you got it: 8 degrees 45' 0" So, do you know a script or something ready to use that works in a shell? Something like this would happen in a terminal: Code:
$ time 8 45 00 # separators maybe ":" too So, do you have something to make that? |
I'm sure complex programs like Mathematica do that, but I haven't run across something free that just does that (not to say such thing doesn't exist), but it should be quite easy to program in C or something if you are so inclined.
|
This would be actually a cool iPhone program to write... hmmm
|
I agree with you, Laserbeak. It is actually not that hard to make, so I imagined that it would exist. Quite useful! I do not know how to use everything my sci calc has, but what I called the "[NICE]" button has been useful several times! (:
I will suggest it to gcalctool, which does not have it - seems - among all its tastes: basic, advanced, financial, scientific and programmable. If I make the script, or if needing a help with some details, I post here. |
Try something like this:
Quote:
Quote:
|
All times are GMT -5. The time now is 10:17 AM. |