Timezone
The Timezone endpoint provides the user's UTC offset over a requested range as {date, value} rows, where value is the offset in minutes and date is the day that offset was recorded. Use this to convert UTC timestamps in timeseries and event data to the user's local time.
GET /v1/timeline/events/timezones/{user_id}
Parameters
| Name | Type | In | Description |
|---|---|---|---|
user_id |
UUID | Path | The unique identifier for the user. |
start_date |
Date | Query | The start date for the query period (format: YYYY-MM-DD). |
end_date |
Date | Query | The end date for the query period (format: YYYY-MM-DD). |
Response Formats
| Header Value | Format |
|---|---|
application/json |
JSON (default) |
text/csv |
CSV |
Example Request (JSON)
cURL
curl -X GET "https://research-api.nowatch.com/v1/timeline/events/timezones/YOUR_USER_ID?start_date=2024-04-01&end_date=2024-04-07" \
-H "accept: application/json" \
-H "X-API-KEY: YOUR_API_KEY"
Example Response
Example Request (CSV)
cURL
curl -X GET "https://research-api.nowatch.com/v1/timeline/events/timezones/YOUR_USER_ID?start_date=2024-04-01&end_date=2024-04-07" \
-H "accept: text/csv" \
-H "X-API-KEY: YOUR_API_KEY"
Example Response (CSV)
Applying timezones
To convert UTC timestamps to local time, look up the value (offset in minutes) for the date of each sample and add that offset.
A positive value (e.g. 120) means UTC+02:00; a negative value means west of UTC.