森蓝小程序

This commit is contained in:
2025-04-23 19:50:30 +08:00
parent 7776447ce3
commit 5205361ac0
111 changed files with 20504 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
const getNowTime = function() {
const now = new Date();
const year = now.getFullYear(); // 获取完整的年份
const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份是从0开始的所以加1并确保是两位数
const day = String(now.getDate()).padStart(2, '0'); // 获取当前日期,并确保是两位数
const hours = String(now.getHours()).padStart(2, '0'); // 获取当前小时0-23并确保是两位数
const minutes = String(now.getMinutes()).padStart(2, '0'); // 获取当前分钟,并确保是两位数
const seconds = String(now.getSeconds()).padStart(2, '0'); // 获取当前秒数,并确保是两位数
// 拼接字符串并返回
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
module.exports = getNowTime;