Open giraffesyo opened 3 years ago
The behavior is reproducible, we need to have look into this along with the timestampz
issue.
Any news about this issue ?
How is this not priority?
Hi, does anyone have a temporary solution? I wouldn't want to format every date I get from the database
Any updates ? the note at Notion (https://www.notion.so/prismaio/Timezone-issues-in-query-engine-and-client-a1a2a9c6096a49f9a63db50c4c68bfe6) went off the air.
This should be a high-priority issue for the Prisma team. Has anyone found a solution for this bug?
Bug description
When you query for a field that is of type
timetz
you get the wrong time back if the time stored in the database is any other timezone besides UTC. For example, I have the following data in a table calledclasses
:As you can see, the third row has a time of 12 PM Eastern time.
However, when you retrieve this time using the following code:
You get the following:
As you can see here, all three times say they are UTC, and the times have not been shifted/offset for the timezones they had in the database. That actually means that the time returned is wrong because now the timezone is lost.
This is a little bit related to #7915 however this is a different problem. That issue is about times always being stored in UTC.
How to reproduce
findMany
to retrieveExpected behavior
It should preserve the timezone that is in the database when giving the data.
Note that there seems to be a closed related issue #6384 but for
timestamptz
Prisma information
The database structure I have is:
Environment & setup
Prisma Version