Next.js Discord

Discord Forum

local dev and vercel time is different

Unanswered
Japanese common catfish posted this in #help-forum
Open in Discord
Japanese common catfishOP
this is a server component

12 Replies

Japanese common catfishOP
local dev - time is correct
but vercel time is wrong
@Japanese common catfish this is a server component
local dev: your timezone
vercel: UTC

you are in UTC+5 right
vercel time is not wrong, just in a different timezone
when you render the time, render it in the timezone of your choice
Japanese common catfishOP
what do i do to solve this?
Japanese common catfishOP
how thats what i want to know
i am new to nextjs
"use client"

const GetCurrentTime = () => {
  const date = new Date()
  return date
}
export default GetCurrentTime

i created this but this does not work when i call it in server component
White Ibis
Wrap time in suspense and disable SSR?
that's also one way. there are many different ways for this