var d=new Date(1111);
console.log(d.getUTCHours()+":"+d.getUTCMinutes()+":"+d.getUTCSeconds()+" "+d.getUTCMilliseconds());
代码如下:
var totalMs = 1111;
var ms = totalMs % 1000;
var seconds = (totalMs-ms)/1000;
var minutes =(totalMs-ms-seconds*1000) % 60
var hours = (totalMs-ms-seconds*1000-minutes*60*1000) % 60
var dtStr = hours + ":" + minutes + ":" + seconds + " " + ms;
console.log(dtStr);