为什么JavaScript日期总是迟到2个小时?

我在JavaScript中使用Date:

 getcurrentDateTime = () => {
    var d = new Date(),dformat =
        [
          d.getDate().padLeft(),(d.getMonth() + 1).padLeft(),d.getFullYear()
        ].join("/") +
        " " +
        [
          d.getHours().padLeft(),d.getMinutes().padLeft(),d.getSeconds().padLeft()
        ].join(":");

    return dformat;
  };

在我的猫鼬模式中:

const mongoose = require("mongoose");
const LoggerSchema = new mongoose.Schema({
  // .. Some attributes 


  InsertDate: {
    type: Date,default: Date.now
  },InsertDateDetailed: {
    type: String
  }
});

module.exports = Logger = mongoose.model(
  "logger",LoggerSchema
);

而且总是迟到2个小时:

为什么JavaScript日期总是迟到2个小时?

为什么?

skiiyxia 回答:为什么JavaScript日期总是迟到2个小时?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3079398.html

大家都在问