<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
//1 用户输入
let second = +prompt('请输入秒数:')
//2 函数的封装
function getTime(t){
let h = parseInt(t / 60 / 60 %24)
let m = parseInt(t / 60 %60)
let s = parseInt(t % 60)
console.log(h,m,s)
h = h < 10 ? '0'+h : h
m = m < 10 ? '0'+m : m
s = s < 10 ? '0'+s : s
// console.log(h,m,s)
return`转换完毕之后是${h}小时${m}分${s}秒`
}
let str = getTime(second)
document.write(str)
</script>
</body>
</html>