Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
quick hours, minutes, seconds string to float func. simply use the format 00:00:00 (.000 optional)
// 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
You can’t perform that action at this time.