Harold
DTDrizzle Team
•Created by Harold on 1/18/2024 in #help
Drizzle storing -1 hour in TIMESTAMP
Do you mean
withTimezone
? I tried that just now and it actually finally works. Still tho I think there is some issue with the timezones because if I set my TZ env to Europe/London
on node and postgres, the timezones are the same everywhere even with mode: 'date'
19 replies
DTDrizzle Team
•Created by Harold on 1/18/2024 in #help
Drizzle storing -1 hour in TIMESTAMP
I save it using
new Date().toISOString()
, this gets saved -1 hour in database, then i receive the same value as is saved in database as an ISO string, so Yes19 replies
DTDrizzle Team
•Created by Harold on 1/18/2024 in #help
Drizzle storing -1 hour in TIMESTAMP
Tried just now, still doesnt work. It saves the date in wrong time zone again
19 replies
DTDrizzle Team
•Created by Harold on 1/18/2024 in #help
Drizzle storing -1 hour in TIMESTAMP
Its very weird, I have been doing more testing. I have my TZ env variable set to Europe/Prague in node and in postgres as well, postgres saves the timestamps in correct timezone and node even logs the correct time zone when logging new Date(). However this one column which i set manually from node and isnt .defaultNow(), gets -1 hour when returning it in a http response json, but when logging it, i get the correct hour and time zone... I also tried chaning my TZ variables to Europe/London both in node and postgres and everything worked as it should.
19 replies
DTDrizzle Team
•Created by Harold on 1/18/2024 in #help
Drizzle storing -1 hour in TIMESTAMP
Europe/Prague, CET
19 replies
DTDrizzle Team
•Created by Harold on 1/18/2024 in #help
Drizzle storing -1 hour in TIMESTAMP
i see this is for postgres.js, im using node-postgres
19 replies
DTDrizzle Team
•Created by Harold on 1/18/2024 in #help
Drizzle storing -1 hour in TIMESTAMP
Also tried removing the
withTimeZone
, still same19 replies
DTDrizzle Team
•Created by Harold on 1/18/2024 in #help
Drizzle storing -1 hour in TIMESTAMP
Tried right now, still the same issue
{
"expectedTimeDone": "2024-01-18T02:30:40.725Z",
"createdAt": "2024-01-18T03:28:40.727Z",
"updatedAt": "2024-01-18T03:28:40.727Z"
}
19 replies