DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk4 min

How to Set Timezone and Locale for Playwright Screenshots

Configure Playwright’s browser locale and timezone for screenshots, distinguish browser context settings from the test runner timezone, and troubleshoot visual differences.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set Playwright’s locale and timezoneId on the browser context used to render the page. In Playwright Test, put them in the global use configuration; use test.use() for a test-specific override. These browser settings do not change the test runner’s timezone.

Set both options for every Playwright Test

Add the options under use in playwright.config.ts:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  use: {
    locale: 'en-GB',
    timezoneId: 'Europe/Paris',
  },
});

Choose a locale tag and timezone identifier that match the scenario you want to test. Playwright’s documented examples include language-region tags such as en-GB and de-DE, and IANA-style zones such as Europe/Paris and Europe/Berlin. The API documentation refers to ICU-supported timezone identifiers. See Playwright’s emulation guide and browser context API.

As an Amazon Associate I earn from qualifying purchases.

Override settings for one test

When only a particular test needs different browser settings, call test.use() in that spec:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import { test } from '@playwright/test';

test.use({
  locale: 'de-DE',
  timezoneId: 'Europe/Berlin',
});

This changes the emulation options for the test rather than requiring a different project-wide default. Consult the emulation documentation for the configuration pattern.

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Set options when creating a browser context directly

If you use Playwright’s library API without the Test runner, pass the same options to browser.newContext() before creating a page:

const context = await browser.newContext({
  locale: 'de-DE',
  timezoneId: 'Europe/Berlin',
});
const page = await context.newPage();

Context options apply to pages created in that context. The browser context API documents these options at browser.newContext().

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

What locale and timezone change

  • locale affects navigator.language, the Accept-Language request header, and locale-sensitive number and date formatting in the browser.
  • timezoneId sets the browser context’s timezone. Its documented default is the system timezone.

These options are browser emulation inputs, not a guarantee that all content will appear in the selected language or that every site will use the same formatting. A site can make additional choices in its own code or content. The documented browser effects are described in the context API.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Browser timezone is not the test runner timezone

timezoneId affects the browser context; it does not set the timezone of Node.js or the Playwright Test runner. If test code generates dates outside the browser and those values must align with browser output, configure the runner environment separately, for example with the TZ environment variable, and verify that the test process uses the intended timezone. Playwright makes this distinction in its emulation guidance.

Rank #3
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Capture screenshots and keep visual baselines stable

Take a screenshot

For a basic capture, save the current page with page.screenshot():

await page.screenshot({ path: 'screenshot.png' });

For the full page or a selected element, Playwright’s screenshot guide documents full-page capture and locator-based capture. For example:

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
await page.screenshot({ path: 'full-page.png', fullPage: true });
await page.locator('main').screenshot({ path: 'main.png' });

See Playwright screenshots.

Use screenshot assertions for visual tests

Playwright Test supports assertions such as await expect(page).toHaveScreenshot(). Its visual-comparison guidance also covers tolerances for expected differences and custom stylesheets that can hide known dynamic elements. Use those controls for specific sources of variation rather than treating a tolerance as a substitute for a stable test environment. See visual comparisons.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep the rendering environment consistent

Matching locale and timezone does not guarantee pixel-identical results. Operating system, browser version, settings, hardware, power source, and headless mode can affect rendering. Generate and compare baselines in the same environment where possible, following Playwright’s visual testing guidance. No single locale or timezone setting compensates for differences in those other inputs.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting

Dates in the screenshot still use the wrong timezone

  • Confirm that timezoneId is set on the context that created the page, not on an unrelated context.
  • If the displayed value is generated by test-runner code and then inserted into the page, check the runner’s timezone separately; browser context settings do not change it.
  • Check the application’s date logic and the specific value being rendered. Browser emulation cannot correct application-level conversions or hard-coded formatting.

The page language or number format does not change

  • Verify that locale is set in the active configuration or context.
  • Remember that locale affects browser language signals, the request header, and formatting behavior, but the site may choose its language using other logic or content.
  • Inspect the page’s navigator.language and the request’s Accept-Language header to confirm what the browser is sending.

The screenshot differs from the saved baseline

  • Check whether locale and timezone match the baseline settings.
  • Keep the operating system, browser version, headless mode, and other rendering conditions consistent.
  • For known volatile elements, use Playwright’s documented screenshot comparison options or custom stylesheet to hide them; avoid widening comparison tolerances without identifying the expected difference.

A timezone identifier is rejected

Use a timezone identifier supported by the environment’s ICU data; the Playwright API documentation points to ICU’s supported identifiers. Check the identifier’s spelling and try a documented region-based identifier such as Europe/Paris or Europe/Berlin.

Or skip the browser setup:

For a hosted screenshot instead of configuring Playwright, ScreenshotNeo accepts one GET request with a URL and returns an image or PDF. Its API supports timezone and geolocation options; see the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture, with each cleanup step able to be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed. An MCP server provides screenshot tools for AI agents, and the free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000. Learn more at ScreenshotNeo. Sign up for 1,000 free screenshots a month with no card.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Do I need to set locale and timezone for every screenshot?

No. Set them globally when the same emulation applies across tests, or override them for a particular test or browser context.

Does Playwright’s locale setting change the operating system language?

No. It configures browser-context locale behavior; it does not change the host operating system.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.