getNowTime() {
var date = new Date();
year = date.getFullYear();
month = date.getMonth() + 1;
var monthStr = month >= 10 ? month : "0" + month;
day = date.getDate();
var dayStr = day >= 10 ? day : "0" + day;
hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
milliSeconds = date.getMilliseconds();
return year + monthStr + dayStr + hour + minute + second + milliSeconds;
}
获取当前时间 (年月日时分秒)
转载
个人笔记专用
本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
上一篇:Vue打开新页面
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
java获取当月最大日
java获取当月最大日
System java 字段