Skip to content

Instantly share code, notes, and snippets.

@zhuzhuaicoding
Created April 8, 2014 02:02
Show Gist options
  • Select an option

  • Save zhuzhuaicoding/10082686 to your computer and use it in GitHub Desktop.

Select an option

Save zhuzhuaicoding/10082686 to your computer and use it in GitHub Desktop.
formatSecond: function (a) {
a = parseInt(a,10);
var b = parseInt(a / 60,10), c = b >= 60 ? parseInt(b / 60,10) : 0, d = a % 60, e = "";
return b >= 60 && (b %= 60), c > 0 && (e += 10 > c ? "0" + c : c, e += ":"), e += 10 > b ? "0" + b : b, e += ":", e += 10 > d ? "0" + d : d
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment