恭喜,你发布的帖子
发布于 2026-01-06 15:27:36
1楼
因为读回来的是UTC时间,所以有时区时差问题,MTP屏幕的时间脚本我平时用的可供参考:
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
请填写推广理由:
分享
只看
楼主