美文网首页
sequelize timezone 配置

sequelize timezone 配置

作者: whtsup | 来源:发表于2019-07-22 22:12 被阅读0次
    
    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

    相关文章

      网友评论

          本文标题:sequelize timezone 配置

          本文链接:https://www.haomeiwen.com/subject/lmiglctx.html