Skip to main content

Endpoint

POST https://api.bunny.build/api/v1/timezone
Also available:
GET https://api.bunny.build/api/v1/timezone/list

Authentication

HeaderRequiredValue
X-API-KeyYesYour API key (bun_...)
Content-TypeYesapplication/json

Overview

Retrieve current timezone details by providing an IANA timezone identifier or a pair of geographic coordinates. The response includes the UTC offset, DST status, and the current local time at that location. Use GET /timezone/list to retrieve all supported IANA timezone IDs.

Use cases

  • Display localized timestamps in scheduling and calendar applications
  • Normalize log timestamps from distributed systems to a single reference zone
  • Determine the local time at a destination for travel applications
  • Localize time-sensitive UI elements such as countdowns and business hours

Request body

Provide either timezone (IANA ID) or both lat and lon (coordinates).
FieldTypeRequiredDescription
timezonestringNoIANA timezone identifier (e.g. "America/Sao_Paulo")
latnumberNoLatitude for coordinate-based lookup
lonnumberNoLongitude for coordinate-based lookup

Example — by IANA ID

{
  "timezone": "America/Sao_Paulo"
}

Example — by coordinates

{
  "lat": -23.55,
  "lon": -46.63
}

Response

200 OK

FieldTypeDescription
timezonestringIANA timezone identifier
abbreviationstringTimezone abbreviation (e.g. "BRT")
utc_offsetstringUTC offset string (e.g. "-03:00")
utc_offset_minutesintegerUTC offset in minutes
current_local_timestringCurrent local time in ISO 8601 format
observes_dstbooleanWhether the timezone currently observes daylight saving time
Example
{
  "timezone": "America/Sao_Paulo",
  "abbreviation": "BRT",
  "utc_offset": "-03:00",
  "utc_offset_minutes": -180,
  "current_local_time": "2025-06-21T10:30:00-03:00",
  "observes_dst": false
}

401 Unauthorized

{
  "detail": "Missing API key. Include X-API-Key header."
}

402 Payment Required

{
  "detail": "Monthly quota exceeded. Upgrade your plan."
}

422 Unprocessable Entity

{
  "detail": "Provide either 'timezone' or both 'lat' and 'lon'."
}

429 Too Many Requests

{
  "detail": "Rate limit exceeded. Try again in 60 seconds."
}

cURL example

curl -X POST https://api.bunny.build/api/v1/timezone \
  -H "X-API-Key: bun_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"timezone": "America/Sao_Paulo"}'