Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert Minutes to Seconds

I have a spreadsheet with values as follows:

1:29.460

I need to convert it to

89.460

I have a huge amount of these play offsets. I can either do it in excel or perhaps using javascript.

Any advice on a formula appreciated!

like image 941
backdesk Avatar asked Jan 18 '12 09:01

backdesk


People also ask

How do we convert minutes to seconds?

Multiply the number of minutes by 60. For example, if you are converting 11 minutes, multiply it by 60 to get 660 seconds. Or, if you are converting 20 minutes, try 20 x 60 = 1,200 seconds.

How do u convert to seconds?

To convert an hour measurement to a second measurement, multiply the time by the conversion ratio. The time in seconds is equal to the hours multiplied by 3,600.

How do you convert minutes and seconds to minutes?

How to Convert Seconds to Minutes. The time in minutes is equal to the time in seconds divided by 60. Since there are 60 seconds in one minute, that's the conversion ratio used in the formula.


1 Answers

Here’s a JavaScript solution:

function convert(input) {
    var parts = input.split(':'),
        minutes = +parts[0],
        seconds = +parts[1];
    return (minutes * 60 + seconds).toFixed(3);
}

convert('1:29.460'); // '89.460'
like image 96
Mathias Bynens Avatar answered Oct 13 '22 00:10

Mathias Bynens