You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and when I trying to query 1 column of this table, it return "2017-06-22T16:00:00.000Z" but the stored value in database is '2017-06-23 00:00:00'.
it turned out the result is still 8 hours early than the correct time.
and I also have try to modify the timezone from +08:00 to +16:00, and the result changed to "2017-06-22T08:00:00.000Z" , which we can say that +16:00(or + 24:00) take affect but +08:00 not.
Same problem too.
My database is using '+8:00' as timezone, and I got '2017-08-10T00:43:04.000Z' while the data in database is '2017-08-10 08:43:04' when setting timezone: '+08:00' in sequelize.
Also, I got '2017-08-09T16:43:04.000Z' when setting without timezone.
But the time is correct when creating no matter what the timezone is.
I am at +08:00 timezone.
I inserted a timestamp field create_time by using new Date()
I found that the time is saved as UTC timezone in my postgreSQL database.
But, when I preform findAll() to the table,
I found create_time is offset by -8 hours,
e.g. 2018-12-06 02:40:06 is outputed as 2018-12-05T18:40:06.604Z
Can I just get what my database is saving? i.e. UTC time
I am at +08:00 timezone.
I inserted a timestamp field create_time by using new Date()
I found that the time is saved as UTC timezone in my postgreSQL database.
But, when I preform findAll() to the table,
I found create_time is offset by -8 hours,
e.g. 2018-12-06 02:40:06 is outputed as 2018-12-05T18:40:06.604Z
Can I just get what my database is saving? i.e. UTC time
Activity
tthos commentedon Jul 24, 2017
I had the same problem too.
My timezone is '+07:00' and value in database is '2017-07-23 00:00:00'
but i got '2017-07-22 17:00:00.000Z'
var sequelize = new Sequelize(config.database, config.username, config.password, { host: config.host, dialect: config.dialect, timezone: '+07:00', })node 8.2.1
mariadb 10.2.7
sequelize 4.4.2
andhikamaheva commentedon Jul 27, 2017
Happened with me too 😞
zlcatwu commentedon Aug 10, 2017
Same problem too.
My database is using '+8:00' as timezone, and I got '2017-08-10T00:43:04.000Z' while the data in database is '2017-08-10 08:43:04' when setting
timezone: '+08:00'in sequelize.Also, I got '2017-08-09T16:43:04.000Z' when setting without timezone.
But the time is correct when creating no matter what the timezone is.
samhoooo commentedon Dec 6, 2018
I am facing the same problem too.
I am at +08:00 timezone.
I inserted a timestamp field
create_timeby usingnew Date()I found that the time is saved as UTC timezone in my postgreSQL database.
But, when I preform
findAll()to the table,I found
create_timeis offset by -8 hours,e.g.
2018-12-06 02:40:06is outputed as2018-12-05T18:40:06.604ZCan I just get what my database is saving? i.e. UTC time
uvzj commentedon Dec 17, 2018
i have the same problem
caltonzhou commentedon Dec 17, 2018
Maybe timezone is not needed if you use UTC.
For example, my mysql server is timezone '+08:00',
"mysql2": "^1.6.4",
"sequelize": "^4.41.2"