time and math

does any body know a formula to convert hours minutes and seconds into a decimal of a day


and a formula to convert it back again
Like this?
12h00'00" = ½
If so, then it isn't much of a formula:
1. convert time to seconds
h*60*60 + min*60 + s
2. divide it by total seconds in the day
t/(24*60*60)
3. profit!

To convert back, multiply the decimal by (24*60*60) and then convert seconds into h/min/s.
hamsterman Thank you,
I think that is right
BTW


2. divide it by total seconds in the day
t/(24*60*60)


8600 sec in a day
Last edited on
8600 sec in a day

You mean 86400.
You mean 86400.


Thank you. I knew that looked wrong.
Here's some interesting reading (which doesn't help the OP, but relates to the subject).
http://tycho.usno.navy.mil/leapsec.html

Quoth the article:
The length of the mean solar day is at present about 86,400.002 seconds

:O)
What we ought to do is strap a few thousand rockets around the equator facing east and accelerate the Earth's rotation until a solar day was back to exactly 86400 s. Hell, make it 86399. That'll teach nature not to mess with our systems of measurement.
Last edited on
What we ought to do is strap a few thousand rockets around the equator facing east and accelerate the Earth's rotation until a solar day was back to exactly 86400 s. Hell, make it 86399. That's teach nature not to mess with our systems of measurement.

Yeah! Next, caesium atoms will be decaying faster, throwing off all our atomic clocks!

@hamsterman,
Hmm... Here it's 0.122974537 o' clock; so now I see why we represent time the way we do...
Last edited on
Topic archived. No new replies allowed.