Skip to content

Instantly share code, notes, and snippets.

@vikasavnish
Created June 16, 2017 11:37
Show Gist options
  • Save vikasavnish/7cde1dcff8f5fc77ddd7d0da42be98d9 to your computer and use it in GitHub Desktop.
Save vikasavnish/7cde1dcff8f5fc77ddd7d0da42be98d9 to your computer and use it in GitHub Desktop.
function parseTime(t1){
t3=t1.split(" ")[1]=='pm'?(parseInt(t1.split(" ")[0].split(":")[0])*60+parseInt(t1.split(" ")[0].split(":")[1])+720):parseInt(t1.split(" ")[0].split(":")[0]*60)+parseInt(t1.split(" ")[0].split(":")[1])
return t3
}
function compare(t1,t2){
console.log(parseTime(t1))
console.log(parseTime(t2))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment