v2.2.1
Time.getPrismaCurrent()
Returns the current time for using with Prisma.
const currentTime = Time.getPrismaCurrent()
await prisma.tip.create({
data: {
user: {
connect: {
id: userId,
},
},
title,
topic,
body,
randomNickname: randomNick,
createdAt: currentTime,
editedAt: currentTime,
},
})
⚠️ Time.getIsoString()
is deprecated
prismaTimeMod()
We assume that prisma treats the time in database as UTC time. Wrapping the result of Prisma client with this function resolves the issue by merely subtracting 9 hours from the UTC time (UTC+9:00 is KST).
First argument could be any variable which includes Date
.