Skip to content

Instantly share code, notes, and snippets.

@remainstheday
Created October 25, 2019 19:57
Show Gist options
  • Save remainstheday/f205cd675df602f5ee29d3bea2c26d24 to your computer and use it in GitHub Desktop.
Save remainstheday/f205cd675df602f5ee29d3bea2c26d24 to your computer and use it in GitHub Desktop.
function timeConvert(n) {
var num = n;
var hours = (num / 60);
var rhours = Math.floor(hours);
var minutes = (hours - rhours) * 60;
var rminutes = Math.round(minutes);
return num + " minutes = " + rhours + " hour(s) and " + rminutes + " minute(s).";
}
console.log(timeConvert(200));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment