> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bunny.build/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /timezone

> Obtenha detalhes de fuso horário por ID IANA ou coordenadas geográficas.

## Endpoint

```
POST https://api.bunny.build/api/v1/timezone
```

Também disponível:

```
GET https://api.bunny.build/api/v1/timezone/list
```

## Autenticação

| Header         | Obrigatório | Valor                        |
| -------------- | ----------- | ---------------------------- |
| `X-API-Key`    | Sim         | Sua chave de API (`bun_...`) |
| `Content-Type` | Sim         | `application/json`           |

## Visão geral

Obtenha detalhes do fuso horário atual fornecendo um identificador IANA ou um par de coordenadas geográficas. A resposta inclui o offset UTC, status de horário de verão e a hora local atual naquele local. Use `GET /timezone/list` para obter todos os IDs IANA suportados.

## Casos de uso

* Exibir timestamps localizados em aplicativos de agendamento e calendário
* Normalizar timestamps de logs de sistemas distribuídos para uma zona de referência única
* Determinar o horário local no destino em aplicativos de viagem
* Localizar elementos de UI sensíveis ao tempo, como contagens regressivas e horários comerciais

## Corpo da requisição

Forneça `timezone` (ID IANA) ou `lat` e `lon` (coordenadas).

| Campo      | Tipo   | Obrigatório | Descrição                                                      |
| ---------- | ------ | ----------- | -------------------------------------------------------------- |
| `timezone` | string | Não         | Identificador IANA de fuso horário (ex: `"America/Sao_Paulo"`) |
| `lat`      | number | Não         | Latitude para busca por coordenadas                            |
| `lon`      | number | Não         | Longitude para busca por coordenadas                           |

### Exemplo — por ID IANA

```json theme={null}
{
  "timezone": "America/Sao_Paulo"
}
```

### Exemplo — por coordenadas

```json theme={null}
{
  "lat": -23.55,
  "lon": -46.63
}
```

## Resposta

### 200 OK

| Campo                | Tipo    | Descrição                                                    |
| -------------------- | ------- | ------------------------------------------------------------ |
| `timezone`           | string  | Identificador IANA do fuso horário                           |
| `abbreviation`       | string  | Abreviação do fuso horário (ex: `"BRT"`)                     |
| `utc_offset`         | string  | String de offset UTC (ex: `"-03:00"`)                        |
| `utc_offset_minutes` | integer | Offset UTC em minutos                                        |
| `current_local_time` | string  | Hora local atual no formato ISO 8601                         |
| `observes_dst`       | boolean | Indica se o fuso horário observa horário de verão atualmente |

**Exemplo**

```json theme={null}
{
  "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

```json theme={null}
{
  "detail": "Missing API key. Include X-API-Key header."
}
```

### 402 Payment Required

```json theme={null}
{
  "detail": "Monthly quota exceeded. Upgrade your plan."
}
```

### 422 Unprocessable Entity

```json theme={null}
{
  "detail": "Provide either 'timezone' or both 'lat' and 'lon'."
}
```

### 429 Too Many Requests

```json theme={null}
{
  "detail": "Rate limit exceeded. Try again in 60 seconds."
}
```

## Exemplo cURL

```bash theme={null}
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"}'
```
