📜  来自 epoch 的 javascript getHours - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:31.102000             🧑  作者: Mango

代码示例1
function convert(t) {
  const dt = new Date(t);
  const hr = dt.getUTCHours();
  const m = "0" + dt.getUTCMinutes();
  
  return hr + ':' + m.substr(-2)
}

console.log(convert(1542895249079));
console.log(convert(1542897015049));
console.log(convert(1542902445344));