How to Capture a Puppeteer Screenshot of a Page in Indian Standard Time
Set Puppeteer’s page timezone to Asia/Kolkata before navigation, then wait for the page and capture the viewport or full page.
Use Puppeteer’s timezone emulation and set it before navigating: await page.emulateTimezone('Asia/Kolkata'). Then open the page, wait for the content you need, and call page.screenshot(). This changes the browser page’s timezone behavior; it does not change the website’s server clock or make the browser appear to be physically in India.
Runnable example
Install Puppeteer in your project if it is not already installed. This example uses ES modules:
npm install puppeteer
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
// Set this before navigation so startup scripts see Indian Standard Time.
await page.emulateTimezone('Asia/Kolkata');
await page.goto('https://example.com', { waitUntil: 'networkidle2' });
await page.screenshot({ path: 'page.png', fullPage: true });
} finally {
await browser.close();
}
Replace https://example.com with the page you want to capture. Puppeteer’s timezone API accepts a timezone identifier supported by ICU. Asia/Kolkata is the appropriate identifier for Indian Standard Time.
Why the order matters
Set the timezone before page.goto() when the page uses browser time during startup. A site may calculate a date, format a timestamp, or choose content as its JavaScript runs. If timezone emulation is applied afterward, that already executed code is not rerun automatically.
Timezone emulation applies to browser-side page behavior. A date rendered on the server and included in the HTML is already text by the time the browser receives it, so changing the page timezone cannot retroactively alter it. The setting also does not change geolocation, IP address, server time, or other location signals.
Choose what to capture
Page.screenshot() captures the current viewport by default. Use fullPage: true for the full page, or clip to capture a specific rectangle. The output type defaults to PNG; use the screenshot options reference for supported types and options such as quality where applicable.
// Current viewport
await page.screenshot({ path: 'viewport.png' });
// Entire page
await page.screenshot({ path: 'full-page.png', fullPage: true });
// A rectangle in page coordinates
await page.screenshot({
path: 'region.png',
clip: { x: 0, y: 0, width: 900, height: 600 }
});
See Puppeteer’s Page.screenshot() API, ScreenshotOptions reference, and screenshots guide for details.
Wait for the right page state
networkidle2 is a useful starting point for pages that finish loading after network activity settles, but it is not a guarantee that every application has finished rendering. Some pages keep background requests open; others render important content after the network is quiet. When possible, wait for a page-specific selector that signals the content you need:
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
await page.waitForSelector('[data-report-ready="true"]');
await page.screenshot({ path: 'report.png', fullPage: true });
Replace the selector with one that exists on the target page. Choose a readiness condition based on the actual content being captured rather than assuming that navigation alone means the page is visually complete.
Troubleshooting
The displayed date or time did not change
Confirm that emulateTimezone() runs before navigation. If the visible value still does not change, the page may have received server-rendered text, restored a value from application state, or calculated and cached it earlier. Timezone emulation affects browser page behavior, not server-generated content.
The page reads time before the setting is applied
Move await page.emulateTimezone('Asia/Kolkata') before page.goto(). If you need to install page-side code for each new document, Puppeteer documents page.evaluateOnNewDocument() for scripts that run on subsequent navigations. It is separate from timezone emulation; it does not make an already completed calculation run again.
The screenshot is blank or missing content
Check whether the page needs more time or a specific element to appear. Try a suitable navigation wait condition, then wait for the content selector before capturing. A screenshot records the rendered state at capture time, so a successful navigation does not by itself prove that the target content is ready.
The screenshot only shows the visible screen
Add fullPage: true for a full-page capture. For a specific portion, provide a clip rectangle with its position and dimensions. If you only need the viewport, leave both options out.
The timezone identifier is rejected
emulateTimezone() requires an identifier supported by ICU. Use Asia/Kolkata and check the API availability and behavior against the Puppeteer version installed in your project.
Reliability, performance, and cost
For reliable output, apply timezone emulation before navigation, wait for the specific page state that matters, and close the browser in a finally block so it is shut down if navigation or capture fails. Choose viewport, full-page, or clipped capture based on the output you actually need; full-page images can be much larger than viewport captures.
This workflow runs a browser through Puppeteer, so your runtime must be able to launch and maintain that browser. Its operational cost depends on your own runtime and infrastructure. Puppeteer’s documentation here does not establish a universal speed or cost figure.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. One GET request returns a screenshot or PDF, and its timezone option can be used when you need page rendering in Indian Standard Time. See the ScreenshotNeo documentation for API parameters.
curl -G "https://api.screenshotneo.com/v1/shot" \
-d access_key=YOUR_API_KEY \
--data-urlencode url=https://example.com \
-d timezone=Asia/Kolkata \
-o shot.webp
Cookie and consent banners, newsletter popups, and chat widgets are removed before the shot. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. An MCP server lets AI agents use screenshot tools. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Sign up free and get 1,000 screenshots a month with no card.
FAQ
How do I set timezone in Puppeteer?
Call await page.emulateTimezone('Asia/Kolkata') before navigating to the page.
How do I make JavaScript show Indian time in a Puppeteer screenshot?
Set the page timezone before the page’s JavaScript runs by calling emulateTimezone() before navigation. This affects browser-side time behavior; server-rendered timestamps remain as delivered unless the application changes them.
Does this change the server’s clock or browser location?
No. It emulates the timezone for the page. Server time and physical or network location are separate.
Which Puppeteer version supports this?
Check the current API reference against the version installed in your project; method availability can depend on that version.


