onGetTimeFrameToTime(starTime, endTime) {
let m = new Date(starTime);
let mt = m.getTime();
let n = new Date(endTime);
let nt = n.getTime();
let s = nt - mt;
let sm = Math.floor(Math.random() * s);
return new Date(mt + sm);
}
onGetTimeFrameToTime(starTime, endTime) {
let m = new Date(starTime);
let mt = m.getTime();
let n = new Date(endTime);
let nt = n.getTime();
let s = nt - mt;
let sm = Math.floor(Math.random() * s);
return new Date(mt + sm);
}
本文标题:Js 从时间范围内取随机时间
本文链接:https://www.haomeiwen.com/subject/myetbdtx.html
网友评论