sequelize = new Sequelize(config.database, config.username, config.password, {
host: config.host,
dialect: 'mysql',
pool: {
max: 5,
min: 0,
idle: 30000
},
operatorsAliases: false, // 消除warning :https://github.com/sequelize/sequelize/issues/8417
define: {
freezeTableName: true,
timestamps: true,
updatedAt: false,
createdAt: false
},
dialectOptions: {
useUTC: false //for reading from database
},
timezone: '+08:00' //for writing to database
});
主要是配置
dialectOptions: {
useUTC: false //for reading from database
},
timezone: '+08:00' //for writing to database
网友评论