Replies: 2 comments 1 reply
-
My recommendation is to store birthdates as strings in your DB. Unless you are storing exact birthdate and time like for a hospital system or something :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
How did you solve this @zanami ? I cannot seem to make it work. Zod returns Date object, but Prisma doesn't take it, don't know why. Saving as a string doesn't seems to smart IMHO since we will loose psql builtin date functions. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm struggling with DateTime as I only need date for a DOB field, for example. I can't populate with what Prisma returns for a DateTime field (something like 1999-06-05T00:00:00.000Z) and I can't save the value from that input as it is back to Prisma (it's a string like '1999-06-05').
For now i'm using zod parse/transform in queries and mutations but I don't feel it's the best (or an OK even) solution
Am I missing something? Any better ideas? Please share!
Beta Was this translation helpful? Give feedback.
All reactions