Skip to content

Instantly share code, notes, and snippets.

<!--
- Copyright 2014-2018 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software

Keybase proof

I hereby claim:

  • I am stekoe on github.
  • I am stekoe (https://keybase.io/stekoe) on keybase.
  • I have a public key ASAs1cxyvM2glyAR3xIj6CJoUUSV0B0QnkCML9AqKX8urwo

To claim this, I am signing this object:

@SteKoe
SteKoe / transformTime.js
Created January 31, 2016 12:47
Convert a given time string hh:mm:ss to the actual seconds
// E.g.: 02:09:07 will result in 7747 seconds
timeStr.split(':')
.reverse()
.map((part, idx) => Math.pow(60, idx) * +part)
.reduce((prev, cur) => prev + cur, 0);