To create a Prisma schema for milliseconds in TypeScript, you can define a new field in your Prisma model as a BigInt
type. This data type can store integers up to 2^53 - 1 which is large enough to represent the number of milliseconds in a date.
88 chars5 lines
Then, you can use the Date
object in TypeScript to represent the date as a Unix timestamp and convert it to milliseconds by multiplying it by 1000.
index.ts302 chars13 lines
This way, you can store and retrieve dates with millisecond accuracy in your Prisma schema using TypeScript.
gistlibby LogSnag