Using prisma 2.24.1 and MySQL 8.0.25. Whenever I insert a date value, it gets stored in the database with a day off by one, for example:
Insert Tue May 30 2006 00:00:00 GMT+0200 (Central European Summer Time) Database: 2006-05-29
I am using the DATE data type of MySQL. I also tried DATETIME to no avail.
My setup is:
myTable (
id int primary key autoincrement,
...
birthdate date,
...
)
schema.prisma according to prisma db pull
model myTable {
id Int @id @default(autoincrement()) @db.UnsignedInt
...
birthdate DateTime? @db.Date
...
}
Insert
await prisma.$transaction(
myTable.map((obj) => {
const dataObject = {
...
birthdate: Date object, containing the date,
...
};
return prisma.myTable.create({
data: dataObject,
});
})
);
Any hints are welcome