获取当前时间
function timeDate(){
let timestamp = Date.parse(new Date());
let date = new Date(timestamp);
//获取年
let Y = date.getFullYear();
//获取月
let M = (date.getMonth() + 1 < 10 ? ‘0’ + (date.getMonth() + 1) : date.getMonth() + 1);
//获取当日
let D = date.getDate() < 10 ? ‘0’ + date.getDate() : date.getDate();
return (Y + ‘年’ + M + ‘月’ + D + ‘日’);
}
温馨提示:本文最后更新于
2024-03-28 10:33:42,某些文章具有时效性,若有错误或已失效,请 联系我们 反馈。👋 感谢您的观看!
© 版权声明
THE END