nodejs关于sequelize 存储时间问题

sequelize 存取时间是按照 UTC标准时间  

官方文档如下

 要想存储北京时间设置timezone为-8:00,

但是一般推荐数据库存储标准时间 在显示时间的时候利用dateformat转化时间格式的时候加上时间,dateFormat(date-(-8*3600*1000), "yyyy.mm.dd HH:MM:ss")    

$ npm install dateformat

$ dateformat --help
 
Date.now()获取到的是当前的localtime,不是Universal time
原文地址:https://www.cnblogs.com/ybleeho/p/8352482.html