local dev and vercel time is different
Unanswered
Japanese common catfish posted this in #help-forum
Japanese common catfishOP
this is a server component
12 Replies
Japanese common catfishOP
local dev - time is correct
but vercel time is wrong
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: 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 GetCurrentTimei 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