Replies: 2 comments 5 replies
-
These are the important parts from the docs section you've linked to:
How do you generate the Also note that dates and times don't automatically update for the client time zone. This is especially important since RSC's don't hydrate at all, otherwise this would cause an inconsistency. If you'd like to have a request-specific time zone, you can read e.g. from Does this help? |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for the quick response, and also for the link to this great blog post. This is exactly the type of thing I've been trying to find on the internet, regarding JS Dates. So to summarize:
So, I'm still thinking of a way to do it. I'm thinking of just not using SSR in situations where I am calling the formatter. I'm not sure if that makes sense... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am having some trouble understanding the timezone configuration needed for server/client components. I see that there is a timezone configuration to be set on both provider and also request config.
https://next-intl-docs.vercel.app/docs/usage/configuration#time-zone
At first, I didn't set any timezone configuration and let the package handle the defaults. I then noticed problems in my testing. Locally, everything was working fine. But when I deployed to production (server is in a different timezone apparently), I started to have problems.
Take a look at this screenshot from my app:
The text (
17 de setembro de 2024 às 23:00
) is the text that was being generated fromformat.dateTime()
. However, the date text is actually supposed to be20:00
(the input on the bottom is the correct date). I think that my server is onUTC
, while my computer is onUTC-3
.So, I am confused as to how to properly setup the timezones on server/client. I think that it is not adapting to each user's client timezones correctly
Beta Was this translation helpful? Give feedback.
All reactions