-
-
Save emberian/2019014 to your computer and use it in GitHub Desktop.
a guest on Mar 11th, 2012 - pastebin.com/0DWetuis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function secondsFromTime(string){ | |
var split = string.split(":") | |
var seconds = parseInt(split.pop()) | |
if (seconds !== NaN) { | |
var minutes = parseInt(split.pop()) | |
if (minutes !== NaN) { | |
var hours = parseInt(split.pop()) | |
if (hours !== NaN) { | |
return hours * 60 * 60 + minutes * 60 + seconds | |
} else return minutes*60 + seconds | |
} else return seconds; | |
}else return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment