【发布时间】:2020-02-19 22:38:13
【问题描述】:
我使用 Mongoose 作为 MongoDB 客户端,使用 Node 并且我在 -5:30 时间得到日期。
数据库中的日期
"createdAt" : ISODate("2020-02-18T05:17:43.368+05:30"),
回复日期
"createdAt": "2020-02-17T23:47:43.368Z"
它正在影响我的应用程序数据。有没有办法得到日期,因为它是 数据库。 谢谢。 如果需要更多信息,请写。
Mongoose 架构
const price = Schema({
}, {
timestamps: true
})
查询
return Price.find(obj)
.sort({
_id: -1
})
.limit(parseInt(query.size) || 100)
.skip((parseInt(query.size) || 100) * (parseInt(query.page) || 0))
.populate('item')
.lean()
服务器时间日期ctl
Local time: Wed 2020-02-19 12:47:29 IST
Universal time: Wed 2020-02-19 07:17:29 UTC
RTC time: Wed 2020-02-19 07:17:29
Time zone: Asia/Kolkata (IST, +0530)
System clock synchronized: yes
ystemd-timesyncd.service active: yes
RTC in local TZ: no
【问题讨论】:
标签: node.js linux mongodb ubuntu mongoose