Jump to content

[SOLVED] Convert standard time to decimal time?


ERuiz

Recommended Posts

Hello all and Merry Christmas,

I have a small problem. I have a variable which outputs a time such as "03:27". And I need this hour value outputted as a decimal time. In this scenario, the desired output would be "3.5".

How can this be accomplished?

The variable containing the standard time is called $arData[31]

Thanks for any help.

Regards,

Efrain Ruiz
Another thing, Orio...

If I have a variable that stores a coordinate exactly in this format:

N18 23.5725 W66 23.8565

And I need to change this coordinate into decimal degrees such as this:

18.3928, -66.3976

In the example above, in order to get the .xxxx value, we need to divide xx.xxxx by 60 (ej: 23.5725/60 = .3928). Also, I need to have a comma separating the 2 values.

How can this be accomplished? Keep in mind that the letter W or S, needs to be converted to a - (negative sign)

The name of the variable is $position

Thanks for any help.

Regards,

Efrain Ruiz

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.