mongoose 中 created_at字段的默认值 Date.now 是不是不能设置时区?如何设置?(默认: 都是格林威治时间)
Date.now
created_at: { type: Date, default: Date.now }
人生最曼妙的风景,竟是内心的淡定与从容!
That’s not necessary. When used, offset the time to the required time zone, or use a function such as toLocalString. default:function(){Date.now() +/- 你需要的时间}, this should save the time in the current time zone
default:function(){Date.now() +/- 你需要的时间}
That’s not necessary. When used, offset the time to the required time zone, or use a function such as toLocalString.
default:function(){Date.now() +/- 你需要的时间}
, this should save the time in the current time zone