Time difference

formatSeconds: function (value) { 
    the let that = the this ; 
var chetheTime = the parseInt (value); // value is a time stamp var timestamp = ( new new a Date ()) the getTime ();. var date3 = chetheTime - timestamp; // Calculation the difference between the number of days var days = Math.floor (date3 / (24 * 3600 * 1000 )) // calculate hours var leave1 date3% = (24 * 3600 * 1000) // after calculating the number of days remaining number of milliseconds var hours = math.floor (leave1 / (3600 * 1000 )) // calculate the number of minutes difference var% = leave1 leave2 (3600 * 1000) // milliseconds after calculating the remaining number of hours var minutes = Math.floor (leave2 / (60 * 1000 )) // calculated difference seconds var leave3 leave2% = (60 * 1000) // the number of milliseconds to calculate the number of minutes remaining var seconds the Math.round = (leave3 / 1000 ) that.setData ({ endtimeNow: (days > 0 (days + "day"):? '') + (hours> 0? (hours + "h"): '') + ( minutes> 0 (minutes + " min"?): '') + seconds + " s" }) } // later again aginBuy: function (E) { Console .log(e) let item = e.currentTarget.dataset.item; let orderd = this.data.orderd; let shopId = orderd.shopId; if (item.type == 0) { wx.navigateTo({ url: '/page/home/pages/shops/shops?cheid=' + shopId }) } else { wx.navigateTo({ url: '/page/near/pages/shops/shops?cheid=' + shopId }) } },

 

Guess you like

Origin www.cnblogs.com/dianzan/p/11504752.html