获取时间戳 只获取到秒的时间戳 new Date(Date()).valueOf()/1000 不包含毫秒数的时间戳 精确到秒的时间戳(Unix时间戳) Math.round(new Date().getTime()/1000) 包含毫秒数,但进行四舍五入精确到秒的时间戳 转载请注明:EZLOST » js技巧一:日期 喜欢 (0)