年 月 日 时间

年月日时间

 let nowDate = new Date();let year = nowDate.getFullYear();let month = nowDate.getMonth() + 1;let day = nowDate.getDate();let hour = nowDate.getHours(); let m = nowDate.getMinutes();let s = nowDate.getSeconds();month = month > 9 ? month : "0" + month;day = day > 9 ? day : "0" + day; hour = hour > 9 ? hour : "0" + hour;m = m > 9 ? m : "0" + m;s = s > 9 ? s : "0" + s;this.time = hour + ":" + m;this.date = year + "/" + month + "/" + day;this.today = nowDate.getDay();

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。