时间戳转换时间格式
时间:2021-09-09 21:38:07
收藏:0
阅读:29
10位时间戳转换年月日时分秒
时间戳转换年月日时分秒:2021-9-8 16:20:40
dateTrans(date) {
let date="1631089240"
return (new Date(parseInt(date) * 1000).toLocaleString(‘chinese‘,{hour12:false})).replaceAll("/","-")
},
判断时间戳有没有超过5分钟,true不超过,false超过
isTimeIn(date){
return new Date().getTime() < parseInt(date)*1000+5*60*1000
}
原文:https://www.cnblogs.com/kerin/p/15244047.html
评论(0)