Back to Prisma

Using CURRENT_TIME

apps/docs/content/docs.v6/postgres/query-optimization/recommendations/current-time.mdx

latest442 B
Original Source

The following raw SQL query uses the CURRENT_TIME function:

ts
prisma.$queryRaw`SELECT CURRENT_TIME;`;

Why this is a problem

The CURRENT_TIME keyword returns only the time (e.g., 14:30:00) without a date, making it unsuitable for tasks like logging or generating timestamps that require precise event tracking. It returns a value of type timetz, which was added for SQL standard compatibility but is generally discouraged.