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

# Timezones & Daylight Saving Time

Flatpeak is **timezone-aware by design**.

All API time handling is based on UTC internally. System-generated timestamps are always returned in **UTC**. However, the API accepts datetime inputs in **any timezone** and will respond in the **same** timezone.

## Use RFC3339 format

All requests must use RFC 3339 timestamps for start\_time and end\_time. You can send:

* **Zulu (UTC) format**: `2025-06-15T00:00:00Z`
* **Offset format**: `2025-06-15T00:00:00+10:00`

These represent different moments in time.

**Examples**:

* `2025-06-15T00:00:00Z` → UTC
* `2025-06-15T00:00:00+10:00` → UTC+10

## Integration Strategy: Choose One Approach

Before integrating, choose a consistent approach to time handling:

* **UTC-first**: Send and process all timestamps in UTC. Convert to local time in your system if needed.
* **Local-first**: Always include the correct local timezone offset in API requests.

## Example

Calling [retrieve-price](/api-reference/anode/prices/retrieve-a-price) endpoint using **UTC** vs **Local Time** for a location in Sydney, Australia:

<Tabs>
  <Tab title="UTC example">
    <CodeGroup>
      ````json Request example theme={"system"}
      curl --request POST \
        --url https://api.flatpeak.com/prices/loc_641b90b758fb8e6293716e40 \
        --header 'Authorization: Bearer <token>' \
        --header 'Content-Type: application/json' \
        --data '{
        "start_time": "2023-06-15T09:00:00Z",
        "end_time": "2023-06-15T23:00:00Z",
        "tariff_direction": "IMPORT"
      }'
      ```json5 Response example
      {
          "id": "prs_68ba8186d1926f4da39601b5",
          "object": "price",
          "location_id": "loc_65e42ce4d3b813479b252160",
          "location_timezone": "Australia/Sydney",
          "currency_code": "AUD",
          "data":
          [
              {
                  "valid_from": "2025-09-15T10:00:00Z",
                  "valid_to": "2025-09-16T10:00:00Z",
                  "tariff":
                  {
                      "rate": 0.014
                      "confidence": 1,
                  }
              }
          ]
      }
      ````
    </CodeGroup>
  </Tab>

  <Tab title="Local time example">
    <CodeGroup>
      ````json Request example theme={"system"}
      curl --request POST \
        --url https://api.flatpeak.com/prices/loc_641b90b758fb8e6293716e40 \
        --header 'Authorization: Bearer <token>' \
        --header 'Content-Type: application/json' \
        --data '{
        "start_time": "2023-06-15T09:00:00+10:00",
        "end_time": "2023-06-15T23:00:00+10:00",
        "tariff_direction": "IMPORT"
      }'
      ```json5 Response example
      {
          "id": "prs_68ba801460cf0890ccb24453",
          "object": "price",
          "location_id": "loc_65e42ce4d3b813479b252160",
          "location_timezone": "Australia/Sydney",
          "currency_code": "AUD",
          "data":
          [
              {
                  "valid_from": "2025-09-15T00:00:00+10:00",
                  "valid_to": "2025-09-16T00:00:00+10:00",
                  "tariff":
                  {
                      "rate": 0.014,
                      "confidence": 1,
                  }
              }
          ]
      }
      ````
    </CodeGroup>
  </Tab>
</Tabs>

## Handling Daylight Saving Time (DST)

If you are using offsets and your request crosses DST transitions, ensure that both `start_time` and `end_time` reflect the correct time offset for the location.

If different time offsets are specified, `end_time` takes precedence. The `valid_from` and `valid_to` times in the response will use the `end_time` offset.

<CodeGroup>
  ```json5 Request example highlight={3} theme={"system"}
  {
    request: {
      start_time: "2025-03-30T00:00:00+01:00",
      end_time: "2025-03-30T04:00:00+02:00",
    },
  }
  ```

  ```json5 Response example highlight={4} theme={"system"}
  {
    data: [
      {
        valid_from: "2025-03-30T01:00:00+02:00",
        valid_to: "2025-03-30T04:00:00+02:00",
        tariff: {
          confidence: 1,
          rate: 0.02,
        }
      }
    ]
  }
  ```
</CodeGroup>

The example above shows how Flatpeak aligns the returned intervals to the `end_time` offset.
