how to change date timezone in mongoose?

前端 未结 6 1275
太阳男子
太阳男子 2021-01-04 11:38

In model schema,

Using

updated: {
    type: Date,
    default: Date.now

In server.js

put(function(req, res) {
    v         


        
6条回答
  •  一生所求
    2021-01-04 12:44

    You can create a Date Object from a specific UTC time:

    new Date(Date.UTC(year, month, day, hour, minute, second))

提交回复
热议问题