Created
February 24, 2018 19:01
-
-
Save vldvel/01431f6d598c6d4acba4e0e440db2f46 to your computer and use it in GitHub Desktop.
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
const arr = s.slice(0,8).split(':'); | |
arr[0] = (s.indexOf('PM') > -1) ? | |
(arr[0] == 12 ? '12' : Number(arr[0]) + 12) : | |
(arr[0] == 12 ? '00' : arr[0]); | |
return arr.join(':'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment