Search code examples
node.jsexpressutcprisma

How to use UTC, while defining model with prisma.js and in generals in express.js project


How can I Run node.js project in UTC instead of local timezone? and How can I use UTC, when I want to define a model with prisma.js?

model Profile {
  CreatedDate  DateTime  @default(now())    // but I need UTC
  ModifiedDate DateTime? @updatedAt        // but I need UTC
}

Solution

  • Prisma automatically stores the date passed in UTC by default. Nothing extra needs to be added.