1 .两个时间对象时间差---相减得到时间差,结果为毫秒数
const d = new Date(time)
const now = Date.now()
const diff = (now - d) / 1000
- Math.ceil floor
取整,向上向下,字符串自动转换
round 四舍五入
random() 0-1之间伪随机数
1 .两个时间对象时间差---相减得到时间差,结果为毫秒数
const d = new Date(time)
const now = Date.now()
const diff = (now - d) / 1000
本文标题:时间、数字
本文链接:https://www.haomeiwen.com/subject/ymfyvftx.html
网友评论