如何按时设置格式? 它显示了16:9:2 它应该显示16:09:02
我的代码:
setInterval(function _timer() {
var time = new Date();
var h = time.getHours();
var m = time.getMinutes();
var s = time.getSeconds();
var fullTime = h + ":" + m + ":" + s;
fullTime.format("hh-MM-ss");// this is not working
$("#time").html(fullTime);
1000
});
答案 0 :(得分:4)
答案 1 :(得分:3)
您可以尝试这样:
})(window["CompanyName"]|| (window["CompanyName"] = {}));