Date.prototype.toLocaleString = function () {//改造Date.prototype.toLocaleString成为24小时制return (this.getFullYear() +"年" +(this.getMonth() + 1) +"月" +this.getDate() +"日 " +this.getHours() +"点" +this.getMinutes() +"分" +this.getSeconds() +"秒");};//获取当前时间戳let unixTimestamp = new Date(new Date().getTime());//转换为24小时标准时间let commonTime = unixTimestamp.toLocaleString();alert(commonTime);
700字范文,内容丰富有趣,生活中的好帮手!