HP Forums

Full Version: ->HR <-> ->HMS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I need the equation to convert ->HR <-> ->HMS. Thank you !!!

I don't believe there is an equation, just some steps you
you have to follow:

-write down the degrees

-take the fractional part and multiply by 60

-the whole number is the minutes

-take the new fractional part and multiply by 60

-the whole number is the seconds and the fractional

part is the fractional seconds.

There should be a button to do all this on a good
calculator.

Edited: 1 Sept 2004, 10:34 p.m.

Hi man, if you really want to have a single équation, I show you what I've found during the last 15 minutes.

H->HMS
f(x)=IP(x)+(1/100)*IP(60.FP(x))+(1/10000)*IP(3600*(FP(x)-(1/60)*IP(60*FP(x))))

HMS->H
f(x)=IP(x)+(1/60)*IP(100*FP(x))+(1/3600)*IP(10000*(FP(x)-(1/100)*IP(100*FP(x)))).

You must enter 15h28mn15s as 15.2815

I've tried it with some examples and I think it's ok.
I hope it will help you.


Edited: 2 Sept 2004, 9:19 a.m.

Also, compare to the equation I wrote in a previous post:

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv014.cgi?read=61505


Edited: 2 Sept 2004, 10:48 a.m.

Thank you

You are welcome!

BTW, I had too many parenthesis:

It should be:

H.MS-->HR:
(FP(100*A)/0.6+IP(FP(A)*100))/60+IP(A)

And Also, here is my solution t'other way 'round:

HR-->H.MS:

IP(x)+IP(FP(x)*60/100+FP(FP(x)*60)*60/10000


Note that the precedence rules of the above text is as per the HP48 series.


These are nice and compact.


Best regards,

Bill