Harold
Harold
DTDrizzle Team
Created by Harold on 1/18/2024 in #help
Drizzle storing -1 hour in TIMESTAMP
Hey guys, im having an issue with timestamp column using Postgres database. When logging a date I get correct current time, however after storing it in database, there is one hour less... I have set my database to +1 time zone this is how the column is defined: expectedTimeDone: timestamp('expected_time_done').notNull(), I have tried setting the timestamp option withTimezone: true, but this doesnt solve it. this is how i set the column data: const expectedDone = new Date(); // Expected done: Thu Jan 18 2024 02:46:07 GMT+0100 (Central European Standard Time) expectedDone.setMinutes(expectedDone.getMinutes() + newTask.duration); // Expected done after adding minutes: Thu Jan 18 2024 02:46:07 GMT+0100 (Central European Standard Time) then db.insert(table).values({expectedTimeDone: expectedDone}) I can just add one hour to the expectedDone, but no. How do I solve this please? using node-postgres
19 replies