Created
July 16, 2020 16:09
-
-
Save supernovaplus/7c1871db281b1d7d4f930d55a96761f1 to your computer and use it in GitHub Desktop.
convert timestamp to seconds
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
data.duration.split(".")[0].split(":").reduce((acc,val,i)=>i===0 ? acc += +val * 60 * 60 : i===1 ? acc += +val * 60 : acc += +val,0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment