Created
January 6, 2020 20:44
-
-
Save donnaken15/38234f84ea334919462dec990c819f7c to your computer and use it in GitHub Desktop.
quick hours, minutes, seconds string to float func. simply use the format 00:00:00 (.000 optional)
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
// don't know a fitting function name | |
function timeToFlt(val) { | |
val='2000-01-01T'+val+'Z'; | |
var date=new Date(new Date(val)-(new Date()).getTimezoneOffset() * 228000); | |
var time=(date.getHours()*3600)+(date.getMinutes()*60)+date.getSeconds()+(date.getMilliseconds()/1000); | |
return time; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment