- Docs
- Parameters
- timezone
timezone
Control the timezone used when rendering your images
How it works
Section titled “How it works”The timezone parameter sets Chrome’s timezone when rendering your image. This affects how dates, times, and any timezone-dependent content are displayed.
Values
Section titled “Values”Pass any valid IANA timezone identifier, such as:
| Timezone | Description |
|---|---|
America/New_York |
Eastern Time (US) |
America/Los_Angeles |
Pacific Time (US) |
Europe/London |
UK Time |
Europe/Paris |
Central European Time |
Asia/Tokyo |
Japan Standard Time |
Australia/Sydney |
Australian Eastern Time |
UTC |
Coordinated Universal Time |
When to use it
Section titled “When to use it”Use timezone when:
- Taking screenshots that display the current time
- Rendering content with timezone-specific dates
- Testing how your application appears in different timezones
- Generating reports for specific regions
Example usage
Section titled “Example usage”Screenshot with specific timezone
Section titled “Screenshot with specific timezone”curl -X POST https://hcti.io/v1/image -u 'UserID:APIKey' \ --data-urlencode url="https://time.is" \ --data timezone="America/New_York"JSON request
Section titled “JSON request”{ "url": "https://calendar.google.com", "timezone": "Europe/London"}HTML with JavaScript dates
Section titled “HTML with JavaScript dates”{ "html": "<div id='time'></div><script>document.getElementById('time').textContent = new Date().toLocaleString();</script>", "timezone": "Asia/Tokyo", "ms_delay": 500}Common use cases
Section titled “Common use cases”Regional reports
Section titled “Regional reports”Generate reports showing local times for different regions:
{ "html": "<div class='report-header'>Generated: <span id='date'></span></div><script>document.getElementById('date').textContent = new Date().toLocaleString();</script>", "timezone": "America/Chicago", "ms_delay": 500}Calendar screenshots
Section titled “Calendar screenshots”Capture calendar views in the correct timezone:
{ "url": "https://calendar.example.com", "timezone": "Europe/Berlin", "viewport_width": 1200, "viewport_height": 800}Testing localized content
Section titled “Testing localized content”Test how your application displays dates for users in different timezones:
{ "url": "https://myapp.com/dashboard", "timezone": "Australia/Melbourne"}Technical details
Section titled “Technical details”When timezone is set:
- JavaScript’s
Dateobject will use the specified timezone Intl.DateTimeFormatwill default to the specified timezone- Any website that detects timezone will see the specified value
Need help?
Talk to a human. Email support@htmlcsstoimage.com and we’ll help you get started.