Du kan prova den här koden, jag hade samma problem och det fungerade för mig.
const sequelize = new Sequelize(mysql.database, mysql.user, mysql.password, {
host: mysql.host,
port:3306,
dialect:'mysql',
define: {
underscored: true,
freezeTableName: true, //use singular table name
timestamps: false, // I do not want timestamp fields by default
},
dialectOptions: {
useUTC: false, //for reading from database
dateStrings: true,
typeCast: function (field, next) { // for reading from database
if (field.type === 'DATETIME') {
return field.string()
}
return next()
},
},
timezone: '+01:00'
});