标签:时间 style str time 计时 mgr cond new 项目
在项目中遇到一个需求,需要对一个活动进行倒计时,每周三次结算时间,分别为周一周三周五的晚上十一点,
var NowDate = RM.NetMgr.getServerTime()*1000; var secondNum = 0; var strtime = ‘1970-01-05 00:00:00:000‘; var date = new Date(strtime.replace(/-/g, ‘/‘)); var time1 = (NowDate - Date.parse(date))%(7*86400000); var week1 = 82800000; var week3 = 255600000; var week5 = 428400000; if(time1 < 82800000){ secondNum = 82800000 - time1; }else if(time1 > 82800000 && time1 < 255600000){ secondNum = 255600000 - time1; }else if(time1 > 255600000 && time1 < 428400000){ secondNum = 428400000 - time1; }else if(time1 > 428400000){ secondNum = 82800000+604800000 - time1; } this.lab_timer.text = this.getTimer(secondNum/1000);
标签:时间 style str time 计时 mgr cond new 项目
原文地址:https://www.cnblogs.com/fohuo/p/9681700.html