Is there a special method where i tell the Prisma ...
# orm-help
a
Is there a special method where i tell the Prisma Client i want the field to be updated with the current database time ?
1
i
you can do something like this in your schema.prisma:
Copy code
createdAt DateTime @default(now())
or you can use it in a raw query if you need that on query level
n
Hey Adam 👋 As Irek mentioned it seems you need to use now which would set the value of current database time to the field.
d
worst case scenario if you need to use in an update scenario, you could 1. create a “dummy” table for getting now 2. create a new record in it 3. get the default createdAt value 4. insert that value into any new/updated records date field(s)
🙏 1