How to Capture Website Screenshots with a Specific Timezone for Audit Documentation
Use Playwright to emulate a named browser timezone, capture the page, and keep a clear provenance record for audit documentation.
To capture a website screenshot with a specific timezone, create a fresh Playwright browser context with its timezoneId set to an IANA timezone such as Europe/Paris, navigate to the page, and save the needed screenshot. Record the configured timezone separately from the capture timestamp: Playwright changes the browser context timezone, not the timezone of the test runner. A screenshot documents what was rendered; by itself, it does not establish compliance with an audit rule or prove that the image was not altered.
1. Choose the timezone and capture scope
Use a named timezone identifier, not just an abbreviation such as “CST.” A named identifier is unambiguous about the zone rules used for the browser environment. Choose the timezone relevant to the page or audit, and record why you selected it.
Decide what visual evidence you need:
- Viewport: the currently visible browser area, useful when the displayed screen is the evidence target.
- Element: a particular component, such as a timestamp or a date-sensitive panel.
- Full page: the scrollable page as one tall image, useful when below-the-fold material matters. This does not guarantee that dynamic or lazy-loaded content reached the same state a live user would see.
If language or regional formatting matters, configure locale separately from timezone and record both. Playwright documents these as separate browser context settings. See Playwright emulation and Playwright screenshots.
2. Capture with Playwright JavaScript
Install Playwright in a project, then install its browser. The example below uses Chromium, creates a new context with a named timezone, opens the target page, and saves a full-page PNG. Replace the URL and timezone with the values for the evidence you are collecting.
npm install playwright
npx playwright install chromium
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
try {
const context = await browser.newContext({
timezoneId: 'Europe/Paris',
});
const page = await context.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.screenshot({ path: 'audit-capture.png', fullPage: true });
await context.close();
} finally {
await browser.close();
}
})();
networkidle can be unsuitable for pages that keep network connections open or poll continuously. In that case, wait for a meaningful selector or a documented page state, and record the wait condition. Avoid arbitrary delays where a stable state can be identified.
3. Other capture scopes and configuration
Viewport screenshot
await page.screenshot({ path: 'viewport.png' });
Element screenshot
const timestamp = page.locator('[data-testid="timestamp"]');
await timestamp.screenshot({ path: 'timestamp.png' });
Use a selector appropriate to the actual page. If the locator matches nothing, the capture will fail; if it matches a hidden or changing element, the result may not show the intended state.
Full-page screenshot
await page.screenshot({ path: 'full-page.png', fullPage: true });
For pages with lazy-loaded content, a full-page image may not reflect content that only loads after scrolling or interaction. If that content is material, reproduce the required user action and wait for the content before capturing; document those actions.
Set timezone alongside other context settings
const context = await browser.newContext({
timezoneId: 'Asia/Tokyo',
locale: 'en-GB',
viewport: { width: 1440, height: 900 },
});
Locale affects regional conventions such as date formatting; timezone affects the browser’s timezone behavior. Viewport dimensions affect layout. Include only settings relevant to the evidence and record them so another operator can reproduce the capture.
4. Keep a reproducible audit record
Save the original image and a separate capture record alongside it. A practical record includes:
- Exact target URL and the date and time of capture, including an explicit UTC offset.
- Configured browser timezone identifier and, when relevant, locale.
- Browser name and version, Playwright version, and operating environment if your process requires it.
- Capture scope: viewport, element and selector, or full page.
- Actions needed to reach the displayed state, including relevant waits and whether authentication or personalized data was involved.
- Output filename and format, plus any later transformations or redactions.
Use a unique filename, preserve the unaltered original, and keep the capture log with it. Playwright’s screenshot API supports PNG, JPEG, and, where supported by the tool, WebP output; a filename timestamp alone does not prove which browser timezone was configured. If redaction is needed, retain the original under appropriate access controls and identify the redacted copy as a derivative. Protect credentials and personal information in both image and log.
These are practical evidence-handling recommendations, not a legally prescribed audit schema. The reviewed tool documentation does not specify a required retention period, chain of custody, hash, signed log, or screen recording. Confirm the evidence requirements with the responsible auditor or authority.
5. cURL, Python, and Node.js options
For a reproducible local capture that explicitly emulates a browser timezone, use Playwright as shown above. The following general-purpose HTTP examples retrieve a screenshot from ScreenshotNeo; they do not set or prove a browser timezone. Use them when a hosted screenshot is useful and the required timezone behavior has been confirmed for your use case. Review the ScreenshotNeo API documentation for request options.
cURL
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
Python
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://example.com"},
timeout=90,
)
r.raise_for_status()
with open("shot.webp", "wb") as f:
f.write(r.content)
Node.js
const q = new URLSearchParams({
access_key: 'YOUR_API_KEY',
url: 'https://example.com',
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
const image = Buffer.from(await res.arrayBuffer());
require('node:fs').writeFileSync('shot.webp', image);
6. Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. Its API takes a URL in one GET request and returns an image or PDF. Cookie banners are accepted and removed before the shot, along with known consent platforms, newsletter popups, and chat widgets; those steps can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits cost nothing, and response headers identify the page verdict and billing status. Its MCP server lets AI agents use take_screenshot, get_page_info, and capture_pdf. The call below captures a URL; it does not configure a timezone, so use the documented browser workflow when explicit timezone emulation is required.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
There are 1,000 screenshots a month free with no card; paid plans start at $5 for 3,000. Sign up for the free plan.
7. Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Invalid timezone error | The timezone identifier is misspelled or unsupported by the browser environment. | Use a valid named timezone such as Europe/Paris or Asia/Tokyo, and check the browser’s timezone support. |
| The page still shows an unexpected date or time | The application may use a server-generated timestamp, a fixed value, or a timezone setting separate from the browser. | Check whether the displayed value is generated client-side or server-side, and document the observed result. Browser timezone emulation does not change the server or test runner timezone. |
| Date formatting differs from the expected region | Timezone and locale are separate settings. | Set the appropriate locale on the context as well as timezoneId, then record both. |
| Navigation waits forever or times out | The page may keep network activity open, poll, or depend on a slow resource. | Use a suitable navigation condition, then wait for a stable, relevant selector or page state. Record the chosen condition. |
| Full-page screenshot omits content | Lazy content may require scrolling, interaction, or additional loading. | Perform the necessary action, wait for the content, and capture again. Record the action and scope. |
| Element capture fails | The selector matched no visible element or the element was not ready. | Use a stable locator, wait for it to appear, and confirm it represents the intended component. |
| Image file is empty or not an image | The request may have failed or returned an error body; a screenshot API response may also indicate a non-clean page verdict. | Check the HTTP status and response headers before saving. For API use, inspect the returned page verdict and billed status rather than assuming every response is a successful image. |
8. Performance, reliability, and cost
A local Playwright run avoids a per-request screenshot service charge but uses your compute and browser setup; page load time, assets, and waits usually dominate capture time. Reuse a browser process for multiple captures when appropriate, while creating a fresh context for each independent timezone or session so state does not leak between captures. Record browser and automation versions when repeatability matters.
Hosted capture reduces browser installation and maintenance, but adds a service dependency and may not expose the timezone control your evidence requires. Confirm the relevant controls before relying on it. ScreenshotNeo charges only for clean shots; its listed plans are Free (1,000/month), Starter ($5 for 3,000), Growth ($15 for 15,000), Pro ($39 for 60,000), Scale ($99 for 250,000), and Business ($249 for 1,000,000). Yearly billing gives two months free, and every feature is on every plan. A service response and a locally saved image still need the provenance and retention handling required by your audit.
9. FAQ
Does changing Playwright’s browser timezone change the machine clock?
No. It emulates timezone behavior in the browser context; the host clock and test runner timezone remain separate.
Can a screenshot prove when a page was captured?
The image alone does not establish a trusted capture time. Keep a separate record with an explicit timestamp and offset, and follow the audit authority’s evidence requirements.
Is a full-page screenshot always better evidence?
No. Use the smallest scope that shows the relevant evidence. A viewport or element capture can make the target clearer; full-page capture is useful when below-fold material is part of the record.
Does this workflow guarantee legal or regulatory acceptance?
No. The cited browser documentation describes tool behavior, not legal sufficiency. Confirm applicable requirements with the responsible auditor or authority.
Primary references
- Playwright: Emulation — browser context timezone and locale settings.
- Playwright: Screenshots — viewport, element, and full-page capture.
- Playwright CLI — command-line screenshot options and filenames.
- Firefox Developer Tools screenshot documentation — manual element and full-page captures. Check the official page URL if using this workflow; it does not establish timezone emulation.


