#Timezone default
1 messages · Page 1 of 1 (latest)
Hello 👋
Prisma will use the timezone that is configured in your MySQL Database. You can configure it in your database by running this SQL:
SET GLOBAL time_zone = '-3:00';
SET SESSION time_zone = '-3:00';
Hello Nurul!
Okay, I'll test. Thank you for your attention
i am setting the configuration in the database but this error keeps appearing.
the row 1 is manually insert with current date and time. Row 2 is inserted by prisma
The code of insert's with prisma.
Prisma models
@hexed plover can you help-me?
@rustic ruin
Based on my research, here's 2 options:
- Do as Nurul suggested and set the global timezone:
https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html
SET GLOBAL time_zone = 'Your_Desired_Timezone';
SET SESSION time_zone = 'Your_Desired_Timezone';
- Convert the timestamp at creation/update:
https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_convert-tz
model Sectors {
createdAt DateTime @default(dbgenerated("CONVERT_TZ(NOW(),'Current_Default_Timezone','Your_Desired_Timezone')"))
}
Hello @merry cargo !
Not work 😦
It was the prism version. I found that version 5.0.0 is not working this.
I went back to 4.17.0-dev.61 and it worked correctly
Oh dang! Wasn't aware of that current issue as I'm using postgres. Thanks for letting me know amd nice job, on figuring it out
Hey @rustic ruin
That's strange. Can you check of you get the same error in prisma 4.16.0?