Created
March 12, 2012 00:58
-
-
Save anonymous/2018992 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(":"); | |
if(seconds = parseInt(split.pop()) ){ | |
if(minutes = parseInt(split.pop()) ){ | |
if(hours = parseInt(split.pop()) ){ | |
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