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

# Dates and time zones

> Select a time range for analytics or query logs.

Analytics and log queries accept `from` and `to` to select a time range. Use a relative value for a rolling window or an absolute timestamp to repeat a query across the same period.

| Format | Example |
| - | - |
| ISO 8601 timestamp | `2026-01-01T00:00:00Z` |
| Calendar date | `2026-01-01` |
| Unix timestamp in seconds | `1767225600` |
| Unix timestamp in milliseconds | `1767225600000` |
| Relative to the time of the request | `-6h`, `-1d`, `-3M`, `now` |

Relative units are case-sensitive. For example, `-5m` means five minutes ago and `-5M` means five months ago.

For an exact instant, include `Z` or a UTC offset in an ISO 8601 timestamp. A date without a time or offset is interpreted at midnight in the server’s time zone. Numeric timestamps from `0` through `2147483647` are interpreted as seconds. Larger values are interpreted as milliseconds.

This request counts queries by status over the last six hours.

```bash theme={null}
curl -sS --get "https://api.nextdns.io/profiles/$PROFILE_ID/analytics/status" \
  -H "X-Api-Key: $NEXTDNS_API_KEY" \
  --data-urlencode 'from=-6h' \
  --data-urlencode 'to=now'
```

For analytics time series with `alignment=clock`, use the `timezone` parameter to align the buckets to a local clock. It affects the bucket boundaries only. Use an [IANA time zone name](https://www.iana.org/time-zones) such as `Europe/Paris` or `America/New_York`. The default is GMT.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.