1***@qq.com
1***@qq.com
  • 发布:2025-03-02 10:40
  • 更新:2025-03-03 09:36
  • 阅读:38

云对象 , 在服务器上 获取到的时间 与中国时间 差 8个小时 (new Date(); date.getHours()), 请问这个问题 怎么解决

分类:uni-app
   let date = new Date()  
const year = date.getFullYear();  
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要 +1  
const day = String(date.getDate()).padStart(2, '0');  
const hours = String(date.getHours()).padStart(2, '0');  
const minutes = String(date.getMinutes()).padStart(2, '0');  
const seconds = String(date.getSeconds()).padStart(2, '0');  

return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;    获取到的小时 有8个小时的 时差  ,请问 这个怎么解决 ?
2025-03-02 10:40 负责人:无 分享
已邀请:
套马杆的套子

套马杆的套子 - 没有解决不了的问题,只有解决不完的问题

要回复问题请先登录注册