87,964
社区成员
发帖
与我相关
我的任务
分享
function time(s,n) {
var d = new Date(s);
d.setMinutes(d.getMinutes()+n*60);
alert(d.toLocaleString());
}
time("2018/06/01 12:01:03",0.2);
time("2018/06/01 12:01:03",24.3);
function time(s,n) {
var d = new Date(s);
d.setHours(d.getHours()+Math.floor(n));
d.setMinutes(d.getMinutes()+n%1*60);
alert(d.toLocaleString());
}
time("2018/06/01 12:01:03",0.2);
time("2018/06/01 12:01:03",24.3);