Node.js Node JS:Date.now()使用服务器开始时间而不是mongoos中的当前时间
我也尝试过使用new Date(),但它对我没有帮助。工作正常Node.js Node JS:Date.now()使用服务器开始时间而不是mongoos中的当前时间,node.js,mongoose,Node.js,Mongoose,我也尝试过使用new Date(),但它对我没有帮助。工作正常 notification_date: { type: Date, default: Date.now() }, 默认日期:No.No.()/代码>关联当前日期,等于服务器启动时的时间,您应该考虑使用默认:日期。在这种情况下,将提供解析函数而不是特定值 notification_date: { type: Date, default: Date.now, }, 非常感谢@Andolsi j
notification_date: {
type: Date,
default: Date.now()
},
<代码>默认日期:No.No.()/代码>关联当前日期,等于服务器启动时的时间,您应该考虑使用<代码>默认:日期。在这种情况下,将提供解析函数而不是特定值
notification_date: {
type: Date,
default: Date.now,
},
非常感谢@Andolsi jihedb一点也不,如果你需要任何东西node js mongodb。。。我在这里
notification_date: {
type: Date,
default: Date.now
}