2 Replies Latest reply: Apr 16, 2014 4:48 AM by Jonathan Dienst

# converting decimals to seconds

I have an Excel spreadsheet with a column that says 2:49, 2 minutes and 49 seconds. When I try

to pick the minutes and seconds I get a strange result. When formatting the cell in Excel I can see

0,00833333333333333. How do I get this to minutes and seconds in my script? Is there any formula

to convert?

kindly

Håkan

• ###### Re: converting decimals to seconds

UI SIDE

TIME(YourFIeldName,'hh:mm:ss') or

TIME(YourFIeldName,'mm:ss')

SCRIPT SIDE

TIME(YourFIeldName,'hh:mm:ss') as YourFIeldName or

TIME(YourFIeldName,'mm:ss') as YourFIeldName

• ###### Re: converting decimals to seconds

Hi

A time value is a decimal number of days where the fractional part represent the time of day (1 = 24h or 1440 minutes). As Manish said, Time() will display the value in hh:mm:ss format.

If you need the minutes value for a calculation, then use something like:

...

YourFIeldName * 1440 As Minutes,

...

will give you a decimal minute value.

HTH

Jonathan