A hydration mismatch on a date often appears only when a reader's time zone or language differs from the server's. In one Remix app the server rendered 1/29/2023, 10:44:09 AM, the browser rendered 1/29/2023, 12:44:09 PM, and React logged "Text content does not match server-rendered HTML", threw the server markup away, and rendered the whole tree again on the client. The page flickered, the console filled with errors #418, #423, and #425, and readers far enough from UTC can see the wrong day.
This guide is for engineers who ship localized pages with Next.js, Remix, Gatsby, or another React framework that renders on the server. It explains the three separate reasons a formatted date or number differs between server and browser, which common fixes quietly break localization, and how to choose a locale, a time zone, and a rendering strategy that keep the text correct on both sides.
The short answer
- Never let a formatter fall back to runtime defaults during server rendering. Pass the page locale and an explicit time zone to every date and number formatter.
- Decide whose time zone each value belongs to: the reader's, the event's, or none at all for date-only values.
- Carry the reader's time zone into server rendering through a cookie or profile setting, and use a fixed
nowfor the request. - Format text that must match exactly once, on the server, and send the string. Use two-pass rendering only where the reader's local clock is the point.
- Test with a browser locale and time zone that differ from the server's, because CI that runs in UTC hides most of these bugs.
Why the same date renders differently
A server-rendered page is formatted twice. Node formats it while building HTML, and the browser formats it again while hydrating. React then compares the two results. The React hydrateRoot reference uses a timestamp as its example of content that differs between server and client, and the Next.js hydration error page lists time-dependent APIs such as the Date() constructor among the causes.
For a localized app, three independent inputs feed that second format, and each one can differ.
The default time zone
Intl.DateTimeFormat uses the runtime's time zone when you omit timeZone. Servers and containers usually run in UTC. Readers do not. The Stack Overflow question on date hydration errors in Remix shows the result: a UTC server and a GMT+2 browser render the same instant two hours apart. A 2026 report in PhotoAlbum issue 126 describes a UTC container rendering 11:15:00 PM while an admin in New York sees 7:15:00 PM, and fa-web-app issue 886 reports that the error appears only when the browser is outside UTC.
The default locale
toLocaleString() and Intl.DateTimeFormat(undefined) use the runtime's default locale. On the server that is the host locale, often en-US, not the locale in your route. memotrail issue 38 reproduces the mismatch with a de-DE browser set to Pacific/Kiritimati against a production server in UTC, where toLocaleString() and Intl.DateTimeFormat(undefined, ...) format with the server's defaults. hyperwhisper-app issue 1963 shows the localization cost directly: a bare credits.toLocaleString() prints 5,000 on the German /de/credits page in an en-US browser, while the package cards on the same page read 5.000 Credits. The hydration error is the visible symptom; the page also shows the wrong number format for its own language.
The ICU data each runtime ships
Even with an explicit locale and time zone, Node and the browser can disagree, because each formats with its own copy of ICU and CLDR data. The Node.js internationalization page says full ICU is the default build, while system-icu builds can have partial locale data. Browsers ship their own versions on their own schedule.
radiokashana issue 164 is a clean 2026 example. The same es-ES call renders 5 de junio de 2018 a las 3:53 p. m. in a Node 22 build and 5 de junio de 2018, 3:53 p. m. in Chromium, and the homepage logs 12 hydration errors. The CLDR 42 release notes describe a large-scale normalization of space characters that "may impact tests of golden data", and Node issue 46123 reports the consequence: Node 18.13 started putting U+202F, a narrow no-break space, before AM and PM. A Stack Overflow question about a Next.js mismatch shows two strings that look identical in the console and differ only in that one character.
Locale support can also differ. The hyperwhisper report says Chromium returned an empty list from Intl.NumberFormat.supportedLocalesOf(['is']) and formatted Icelandic numbers as 5,000, while Node formatted 5.000. That is an author report, but supportedLocalesOf exists for exactly this: it returns the locales a runtime can format without falling back to its default.
Decide whose time zone a value belongs to
Most hydration fixes pick a time zone by accident. Pick it on purpose, per field, before writing any rendering code.
| Value | Belongs to | Format with |
|---|---|---|
| Comment posted, message sent, last login | The reader | Reader's zone from cookie or profile |
| Flight departure, store hours, live event | The place or event | The event's IANA zone, with the zone shown |
| Birthday, due date, publication date | No zone | Calendar date fields, no instant conversion |
| Audit log for support staff | The organization | A fixed zone, labeled |
Forcing UTC or en-US on both sides removes the error by showing every reader the server's calendar day and number format, so decide whose time zone each value belongs to before you pick a fix. Some 2026 fixes in public repositories do this. leothesen pull request 179 formats page dates in UTC to stop hydration errors after a static build in UTC showed October 1 while a reader in Asia/Shanghai saw October 2. The error goes away, and the Shanghai reader now sees October 1 for something edited on their October 2. That is fine for a "last edited" label on a personal blog. On a booking page or a chat timeline it is a localization bug that no longer throws.
Date-only values are their own case. akomapa-health issue 310 reports news dates stored as "2026-10-14" showing as October 13 for readers west of UTC, because new Date() reads a date-only string as UTC midnight and the formatter then applies a negative offset. The same report notes that CI runners in UTC hid the failure. The fix is to keep date-only values as calendar fields, which our guide to localizing app dates, times, and numbers covers in its data-model section.
Carry locale and time zone into server rendering
Once you know which zone a value needs, make the server able to use it. The locale is usually already in the route. The reader's time zone is not in the request, so you have to store it.
A small client script can read the browser zone from resolvedOptions().timeZone and write it to a cookie on first visit. Signed-in users can keep a profile setting that wins over the cookie.
// Runs once in the browser, for example in a root client component.
const zone = Intl.DateTimeFormat().resolvedOptions().timeZone;
if (!document.cookie.includes("tz=")) {
document.cookie = `tz=${encodeURIComponent(zone)}; path=/; max-age=31536000; samesite=lax`;
}
On the server, resolve both values once per request and pass them everywhere. With next-intl, the request configuration accepts a timeZone and states that, by default, the time zone of the server runtime is used. That default causes the mismatch. The same page says the zone can come from a user profile, the locale, or a cookie, and that client components inherit it when NextIntlClientProvider is rendered from a server component.
// i18n/request.ts
import { getRequestConfig } from "next-intl/server";
import { cookies } from "next/headers";
export default getRequestConfig(async ({ requestLocale }) => {
const locale = (await requestLocale) ?? "en";
const store = await cookies();
const timeZone = store.get("tz")?.value ?? "UTC";
return {
locale,
timeZone,
now: new Date(),
messages: (await import(`../messages/${locale}.json`)).default,
};
});
The now value matters for relative labels such as "5 minutes ago". The next-intl dates and times page provides useNow and a global now so server and client compute the difference from the same reference point. Without it, a label computed a second apart on each side can round differently. The new Date().toString() case in this Stack Overflow question shows the same problem with a plain clock: the server and client strings differ by one second.
The first visit is still a gap. Before the cookie exists the server falls back to a default zone, and the first page view can still mismatch for reader-zone values. Treat that one render as a known case: either render reader-zone values on the client for visitors without the cookie, or accept a single correction after hydration.
If you do not use next-intl, apply the same rule by hand. Build one formatter factory that requires a locale and a time zone, and ban toLocaleString() without arguments in lint.
export function makeDateFormatter(locale: string, timeZone: string) {
return new Intl.DateTimeFormat(locale, {
dateStyle: "medium",
timeStyle: "short",
timeZone,
});
}
Choose between formatting once and two-pass rendering
With explicit inputs, most mismatches disappear. The ICU difference does not, and you still need a strategy for values in the reader's local clock.
Format once on the server
Passing the same locale and time zone to both sides is not enough when Node and the browser carry different ICU data, so format text that must match exactly once on the server, or check supportedLocalesOf on both runtimes. If a server component formats a date and passes the string to the client as a prop, the browser never formats it, so there is nothing to compare. This is the right default for publication dates, prices, and anything a crawler should see in the HTML, which is what the author of this question about blog dates on server and client wanted.
The tradeoff is that the string is fixed at render time. It follows the server's ICU data, so it can differ slightly from what the browser would produce, and a cached page shows the zone of whoever triggered the render unless the cache key includes the zone. For static or shared caches, format in the content's own zone or as a date-only value rather than in the reader's zone.
When you need the client to format, check locale support on both runtimes during build or startup. If supportedLocalesOf drops a locale on either side, format that locale's values on the server only.
Two-pass rendering
Some values only make sense in the reader's current clock, such as "today at 9:00" in a chat. React documents two-pass rendering for content that must differ: render a stable placeholder on the server and on the first client pass, then set an isClient state in an Effect and render the real value. Josh W. Comeau's perils of rehydration walks through the same pattern with a hasMounted flag.
"use client";
import { useEffect, useState } from "react";
export function LocalTime({ iso, locale }: { iso: string; locale: string }) {
const [text, setText] = useState<string | null>(null);
useEffect(() => {
setText(
new Intl.DateTimeFormat(locale, { timeStyle: "short" }).format(new Date(iso)),
);
}, [iso, locale]);
return <time dateTime={iso}>{text ?? "\u00a0"}</time>;
}
The cost is a placeholder in the HTML and a layout shift unless you reserve space. Keep the machine-readable dateTime attribute so the instant is still in the markup. Use this pattern for reader-clock values only, not as the default for every date.
What suppressHydrationWarning does
suppressHydrationWarning leaves the server's text on screen, so on a localized date it ships the server's time zone and locale to the reader instead of fixing the mismatch. The Next.js error page says the attribute only works one level deep, is an escape hatch, and that React will not attempt to patch mismatched text content when it is set. React's own reference calls it a way to silence an unavoidable mismatch, with a timestamp as the example.
Silencing is fine when both versions are acceptable, such as a "rendered at" footer. For a German page whose server formatted 5,000 in English style, or a UTC timestamp shown to a reader in New York, it hides the warning and keeps the wrong text. Only add it after you have decided that the server's version is the one you want the reader to see.
Test with a locale and time zone the server does not use
These bugs survive because development machines, CI runners, and servers often share a zone. The akomapa report is typical: the end-to-end test failed locally and passed in UTC CI. Make the browser differ from the server on purpose.
Playwright emulation sets locale and timezoneId for a browser context, and the same page notes that this affects only the browser, not the test runner, which needs the TZ environment variable.
// playwright.config.ts
import { defineConfig } from "@playwright/test";
export default defineConfig({
projects: [
{ name: "de-berlin", use: { locale: "de-DE", timezoneId: "Europe/Berlin" } },
{ name: "en-la", use: { locale: "en-US", timezoneId: "America/Los_Angeles" } },
{ name: "ja-tokyo", use: { locale: "ja-JP", timezoneId: "Asia/Tokyo" } },
],
});
Run the server with TZ=UTC and a different default locale from every project. Then add three kinds of assertion:
- Fail the test on any console message that contains "hydration" or React errors #418, #423, or #425.
- Assert the rendered text for a few fixed fixtures per locale: a reader-zone timestamp near midnight UTC, a date-only value, and a number with a thousands separator.
- Compare against formatter output built with the same locale and zone, not hand-typed strings. The CLDR 42 note on space characters is a reason never to hard-code
10:00 AMwith an ASCII space.
Add one more check when you add a locale: call supportedLocalesOf for it in Node and in each target browser, and fail the build if either side drops it.
Common mistakes
- Calling
toLocaleString()ortoLocaleDateString()with no arguments in a component that renders on the server. It formats in the host's locale and zone. - Passing a locale but not a
timeZone. The Next.js timeline question passes'en-US'with no time zone, and the server printsMay 2022where the client printsApr 2022. - Fixing the error by forcing UTC for values that belong to the reader.
- Adding
suppressHydrationWarningto a localized number or date and calling the bug closed. - Parsing date-only strings with
new Date()and then formatting them in a local zone. - Caching a server-rendered page that contains reader-zone text without the zone in the cache key.
- Relying on CI in UTC to catch zone bugs. staaash issue 337 found React error 418 in six London and New York combinations against a UTC server, while the UTC controls passed at first and failed only intermittently around relative-time boundaries.
Next step
Search your codebase for toLocaleString(, toLocaleDateString(, toLocaleTimeString(, and Intl.DateTimeFormat(undefined in files that render on the server. For each hit, write down whose zone the value belongs to, then either pass the route locale and an explicit zone or move the formatting to the server and send a string. Add one Playwright project with a non-UTC zone and a non-English locale, and fail it on hydration warnings. If you are setting up a new Next.js app, wire the locale and zone into request configuration at the same time you set up routing, as in our Next.js i18n guide, so every hydration mismatch on a date has one place to be fixed.
