0

i work with sequelize 6.14.11, nodeJs 14.16.0, and postgres 13.2.

I post data with a column createdAt like this '2021-06-23 15:23:52.39+02' but when i get data, the value of createdAt is '2021-06-23T13:23:52.39Z'.

I configure sequelize with this :

sequelize = new Sequelize(config.database, config.username, config.password, {dialect: 'postgres', dialectOptions: {useUTC: false}, timezone: '+02:00'});

I need help, i don't understand, please, thanks

  • postgres usually converts dates to UTC timezone 0 when it stores them. Here are two stack overflow questions that may be helpful: https://stackoverflow.com/questions/51132868/incorrect-date-fetched-from-postgres https://stackoverflow.com/questions/17976459/utc-date-in-sequelize-js – mazoula Jun 24 '21 at 04:28

0 Answers0