Fix timezone issue by using the Date() class instead of SQL NOW()#11
Fix timezone issue by using the Date() class instead of SQL NOW()#11yuvalt wants to merge 2 commits intomgcrea:masterfrom
Conversation
|
Hi, thanks for the PR! The issue that I see is that having mismatched timezone does lead to other issues like having Agree that I don't really like the Will investigate a bit more, |
|
Haven't tested it directly with prisma ( via We're using this in our trigger logic while creating the audit records and previously we had the problem, that the timestamp ( via |
I tried to set the timezone option and it didn't work actually. |
|
Hello @mgcrea -- did you get a chance to think about this? |
|
Merged with improvements! Thank you @yuvalt for identifying this timezone issue and providing the initial fix. The final implementation includes:
Commit: 47c7b3a |
I'm in New York timezone, and that could be the reason why I see this issue. When the data is inserted to the database, it is in UTC. However due to the way the code is written, it will not actually dequeue until five hours later because of timezone issues in the code. My change fixes that (I verified). You should consider removing the timezone config option which way probably a way to try and resolve the issue... setting the timezone on the entire database is too intrusive, imho.