我需要一些代码来解决购物网站中的实时倒计时问题,比如交易到期时间。
我在mysql中有一个到期时间,当页面显示时,它将显示到期时间。它还将根据服务器时间计算响应到达客户端后的数据包传递时间。
您可以使用JQUERY来实现它..
$(function(){
$("#future_date").countdowntimer({
dateAndTime : "2018/01/01 00:00:00"‚
size : "lg"‚
regexpMatchFormat: "([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})"‚
regexpReplaceWith: "$1<sup>days</sup> / $2<sup>hours</sup> / $3<sup>minutes</sup> / $4<sup>seconds</sup>"
});
});
复制自:http://harshen.github.io/jquery-countdownTimer/