How can I convert a decimal hour value like 1.6578 to hh:mm:ss in jquery or javascript?
I only managed to do it to hh:mm using this code:
var decimal
Rather than doing the calculations yourself, use built-in functionality to set the seconds on an arbitrary date of a Date object, convert it to a string, and chop off the date part, leaving just the hh:mm:ss string.
var decimalTimeString = "1.6578";
var n = new Date(0,0);
n.setSeconds(+decimalTimeString * 60 * 60);
document.write(n.toTimeString().slice(0, 8));