Ensure you are using a different timezone in your browser/OS then UTC.
Click in the nav on "Example 1: Without supressed warning".
You can see that the date is first rendered using the servers timezone (UTC) but during hydration, the date is changed to the users timezone. You can also see a error happpening in the console: Text content does not match server-rendered HTML.
Click on the nav on "Example 2: With supressed warning".
You can now see the exact same page with only one difference: the div wrapping the time has a supressHydrationWarning set. But you can now also see, the date is not localized to uses timezone anymore. Instead the server time is shown.
Still on the same page (Example 2), open you console, you can see that the console log, called in the LocalizedDateTime is actually called and loggs the localized that should have been shown on the page. So "hydration execution" still seams to happen, but the HTML is not added to the DOM.
Click on the nav on "Example 3: combined"
Here you can see the date twice, one with supressHydrationWarning and one without. This time both are localized.
Current vs. Expected behavior
Following the steps from the previous section, I would expect that the date always gets localized to the users timezone during hydration. The only difference I would expect is that when suppressHydrationWarning is set, only the warning disappears, but the hydration should still happen.
Even the nextjs docs mention timestamps as a situation where suppressHydrationWarning could be used.
Link to the code that reproduces this issue
https://github.com/derweili/nextjs-hydration-issue/
To Reproduce
Text content does not match server-rendered HTML.
supressHydrationWarning
set. But you can now also see, the date is not localized to uses timezone anymore. Instead the server time is shown.supressHydrationWarning
and one without. This time both are localized.Current vs. Expected behavior
Following the steps from the previous section, I would expect that the date always gets localized to the users timezone during hydration. The only difference I would expect is that when
suppressHydrationWarning
is set, only the warning disappears, but the hydration should still happen.Even the nextjs docs mention timestamps as a situation where
suppressHydrationWarning
could be used.Provide environment information
Which area(s) are affected? (Select all that apply)
App Router
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed)
Additional context
I tested on multiple environments, Mac, Windows, Deployed on Vercel. So its not a environment specific issue.