Timezone-Aware Queries
Stream data is always stored in UTC. Many questions, however, are asked in civil (wall-clock) time for a specific place: "what were the values yesterday? this week? last month?" — meaning the local day / week / month boundaries of a chosen time zone, not a UTC day that is shifted against the local one.
This becomes essential the moment one chart compares metering points across zones — a site in Europe/Vienna next to one in Europe/Lisbon. A single UTC bucket boundary cannot represent "yesterday" for both. Timezone-aware queries resolve civil-time ranges and align rollup buckets to a chosen zone, DST-correctly, while storage stays UTC.
Computation (query): which UTC window is "yesterday in Europe/Vienna", and which rollup holds that zone's civil days. Display (UI): rendering the chart axis in local time. This page is about computation; display is a rendering concern handled independently.
Where the time zone comes from
Two independent inputs cooperate:
| Input | Set on | Role |
|---|---|---|
| Reference time zone | the rollup archive (ReferenceTimeZone) — see Stream Data Archives | A property of the series' physical location. Makes the stored calendar buckets (CalendarDay / Iso8601Week / CalendarMonth / CalendarQuarter / CalendarYear) DST-correct. Provisioned with the archive. |
| Query time zone | the query (timeZone) | The zone the query is answered in — used to resolve relative ranges and to select the calendar rollup whose civil days match. |
Both use IANA names only (Europe/Vienna, Europe/Lisbon) — never fixed offsets, which are wrong twice a year across DST.
Resolving a series query in a zone
The resolution-aware series resolver (streamData.resolveSeriesQuery, and the MCP tool resolve_series_query) accepts two optional inputs:
| Field | Values | Default | Meaning |
|---|---|---|---|
timeZone | IANA id, e.g. Europe/Vienna | (empty ⇒ UTC) | The zone calendar rollups are aligned to and selected against. |
comparisonPolicy | PerQuery / PerSeries | PerQuery | How civil boundaries resolve when a query spans series in different zones. |
query {
streamData {
resolveSeriesQuery(input: {
baseArchiveRtId: "…"
from: "2026-01-01T00:00:00Z"
to: "2027-01-01T00:00:00Z"
targetPoints: 365
requiredAggregation: SUM
sourcePath: "Amount.Value"
timeZone: "Europe/Vienna"
comparisonPolicy: PerQuery
}) {
archiveRtId
effectiveBucketMs
points
signal
}
}
}
The resolver returns the archive to query and the effective bucket width; you then run the downsampling query against archiveRtId.
Day start (gas days)
A CalendarDay rollup can start its days at a local time other than midnight (DayStartOffsetMs, see Stream Data Archives — Day start). A gas day, for example, runs from 06:00 to 06:00 local time. Tell the resolver which day you ask for:
| Field | Values | Default | Meaning |
|---|---|---|---|
dayStartOffsetMs | milliseconds after local midnight, a whole minute in [0, 86400000) | (empty ⇒ midnight) | Local day start of the query, e.g. 21600000 = 06:00. |
binOrigin | local time HH:mm, e.g. "06:00" | (empty ⇒ midnight) | The same day start in the notation of the downsampling query. Give one of the two; both with different values are refused. |
Under PerQuery a CalendarDay rollup is a candidate only when its own day start equals the query's: a gas-day request is answered from the gas-day rollup, and a midnight request never reads gas days (and the other way round). Without a day start every request is a midnight request. Under PerSeries each rollup answers in its own calendar.
query {
streamData {
resolveSeriesQuery(input: {
baseArchiveRtId: "…"
from: "2026-10-01T04:00:00Z"
to: "2026-11-01T05:00:00Z"
targetPoints: 31
requiredAggregation: COUNT
sourcePath: "Amount.Value"
timeZone: "Europe/Vienna"
binOrigin: "06:00"
}) { archiveRtId effectiveBucketMs points signal }
}
}
Comparison policy
PerQuery(default) — one query zone is applied uniformly. "Yesterday" is one civil day in the query zone. A calendar rollup is a valid source only when its storedReferenceTimeZonematches the query zone; a rollup holding a different zone's civil days is excluded from selection (its buckets are not this query's civil days).PerSeries— each series resolves its own local day in its archive'sReferenceTimeZone("each site's local yesterday"). Reuses the existing per-source fan-out.
The query window [from, to) and the rollup's bucket boundaries must be computed against the same zone, or the window edges land mid-bucket. Under PerQuery both use the query zone; under PerSeries the range is resolved per series in that series' zone. This is what keeps side-by-side charts from being "off by hours".
Calendar rungs vs. sub-day rungs
- Civil day and coarser (
CalendarDay/Iso8601Week/CalendarMonth/CalendarQuarter/CalendarYear): a rollup carrying a matchingReferenceTimeZonealready stores DST-correct local buckets — one stored bucket is one civil unit, read directly. - Sub-day, fixed-size (1 h and finer,
FixedSize): time-zone-independent.DATE_BINbins are evenly spaced from a UTC epoch; the zone affects only the axis labels, not the bins. Civil-boundary semantics are a property of calendar-aligned rollups only.
If a civil-day query finds no matching-zone calendar rollup, the resolver returns a truthful signal (ResolutionLimited / NoSuitableRollup) rather than silently mis-aligning — provision a CalendarDay rollup in the required zone to enable it.
timeZone costs you the calendar rungs — and the coverage signal with themtimeZone defaults to UTC, and under the default PerQuery policy that excludes every calendar rollup whose ReferenceTimeZone is a real zone. What is left of the ladder is the fixed-size rungs, and the coverage filter only reports CoverageLimited when it changes the resolver's choice: with a single remaining rung there is nothing to change to, so the call answers Ok on that rung even when its measured coverage starts after the requested from. The history is not missing — it sits in the calendar rung the zone rule dropped.
Always pass the zone the question is asked in. A board does this for you (its Time Filter zone flows into the resolver); a hand-written resolveSeriesQuery or resolve_series_query call has to say so itself.
CalendarQuarter (since System.StreamData 1.8.0) behaves exactly like CalendarMonth: quarters start on 1 January, 1 April, 1 July and 1 October in the rollup's ReferenceTimeZone, so the quarter containing a DST switch is simply one hour shorter or longer in UTC. An empty zone yields UTC quarters.
Validity spans are read in the reference zone too
A rollup that draws from several source archives declares a half-open validity span per source, and every ValidFrom / ValidTo must land on a bucket boundary of the rollup, interpreted in its ReferenceTimeZone — the same zone the buckets themselves are aligned to. A boundary that is aligned in UTC but not in the reference zone (or vice versa) is rejected at create and at activation. That is what keeps every bucket entirely inside exactly one source's span, so a cutover between a legacy and a native source never splits a civil day, month or quarter.
See Stream Data Archives — Validity spans, and the engine decision doc octo-construction-kit-engine/docs/concept-multi-source-rollups.md for the rule-level description.
Local-day bins in downsampling queries
The transient downsampling query (streamData.transientStreamDataQuery.downsampling) normally cuts [from, to) into limit bins of equal width from a UTC epoch. With one of the following arguments the bins are local days instead — cut with the same boundary logic as CalendarDay rollups, so a bin over a raw archive and a bucket of a day rollup with the same zone and day start cover the same instant:
| Argument | Values | Default | Meaning |
|---|---|---|---|
timeZone | IANA id, e.g. Europe/Vienna | UTC | The zone the days are cut in. A day across a DST change is 23 or 25 hours long. |
binInterval | whole days, at least 1 | 1 | Width of one bin. Weeks and months are served by calendar rollups. |
binOrigin | local time HH:mm | 00:00 | Local time of day at which a bin starts, e.g. "06:00" for a gas day. Same meaning as DayStartOffsetMs of a day rollup. |
With local-day bins limit is not needed (the bins follow from the range); from and to are required, and one query may produce at most 10,000 bins. A day without data is returned as an empty bin (COUNT 0). An unknown zone, an origin that is not HH:mm or not a whole minute, or an interval below one day is refused with an error that names the argument. Without the three arguments the query behaves exactly as before.
Example — count the hourly values per gas day in Europe/Vienna:
query {
streamData {
transientStreamDataQuery {
downsampling(
archiveRtId: "…"
columnPaths: [{ attributePath: "Amount.Value", aggregationType: COUNT }]
from: "2026-03-28T05:00:00Z"
to: "2026-03-29T04:00:00Z"
timeZone: "Europe/Vienna"
binOrigin: "06:00"
binInterval: 1
) { items { rows(first: 100) { items { cells(first: 5) { items { attributePath value } } } } } }
}
}
}
With complete hourly data the gas day starting 2026-03-28 (spring forward) counts 23, the one starting 2026-07-01 24, and the one starting 2026-10-24 (fall back) 25 — over the raw archive and over a CalendarDay Count rollup with ReferenceTimeZone = Europe/Vienna and DayStartOffsetMs = 21600000 alike.
One row per series
Over many series (rtIds) the query above returns one total per bin. With groupByColumnPaths: ["rtId"] it returns one row per series and bin instead, so per-series day counts need one query, not one per rtId:
| Argument | Values | Default | Meaning |
|---|---|---|---|
groupByColumnPaths | ["rtId"] | (empty ⇒ one row per bin) | Series key of the rows. The key is returned as the cell rtId after timestamp, and as the first entry of columns. Other paths are refused with an error that names them; group by other columns with groupingAggregation. |
With local-day bins every series gets every bin of the range: a gas day without any value of one series is a row for that series with COUNT 0 (other aggregations null), on raw archives and on CalendarDay rollups alike. A series without any value in the whole range is not known to the query and has no rows. The result is built as a whole: a query that needs more than 100,000 rows (bins x series) is refused with an error naming bins and series, whatever page size is asked for; shorten the range, widen binInterval or pass fewer rtIds. totalCount and paging (first / after) count the result rows, i.e. series x bins; the rows come ordered by bin, then by series. With fixed-width bins (limit, no local-day argument) the series are grouped too, but an empty bin is one row without rtId, as before.
query {
streamData {
transientStreamDataQuery {
downsampling(
archiveRtId: "…"
columnPaths: [{ attributePath: "Amount.Value", aggregationType: COUNT }]
from: "2026-03-27T05:00:00Z"
to: "2026-03-30T04:00:00Z"
timeZone: "Europe/Vienna"
binOrigin: "06:00"
binInterval: 1
groupByColumnPaths: ["rtId"]
rtIds: ["…", "…", "…"]
) {
items {
columns { attributePath }
rows(first: 1000) { totalCount items { cells(first: 5) { items { attributePath value } } } }
}
}
}
}
}
With complete hourly data for three series the result has 9 rows (3 series x 3 gas days); each row has the cells timestamp, rtId and amountvalue_count, and the counts are 24, 23 and 24 per series. A series without values on the gas day starting 2026-03-29 still has its row for that day, with amountvalue_count 0.
Through the MCP server
The MCP tool query_stream_data_downsampling takes the same three options as optional parameters: timeZone, binIntervalDays (whole days, 1 to 10,000) and binOrigin (HH:mm). With any of them the bins are local days and limit is ignored; without them the tool behaves as before. An invalid value returns IsSuccess=false with the message that names the parameter. get_rollup_query_metadata returns referenceTimeZone and dayStartOffset (HH:mm, plus dayStartOffsetMs) of a rollup, so an assistant can ask for bins that match its days. A null referenceTimeZone means UTC; null dayStartOffset / dayStartOffsetMs mean the days start at local midnight (or the rollup is not day-aligned, see bucketAlignment) — use 00:00, not a gas-day origin. Gas days over three days around the spring DST change:
{
"tool": "query_stream_data_downsampling",
"parameters": {
"archiveRtId": "69fda707d47638c68edc7fea",
"aggregations": [ { "function": "count", "attributePath": "Amount.Value", "alias": "n" } ],
"from": "2026-03-27T05:00:00Z",
"to": "2026-03-30T04:00:00Z",
"timeZone": "Europe/Vienna",
"binOrigin": "06:00",
"binIntervalDays": 1
}
}
The response has one row per gas day, bucketStart 2026-03-27T05:00Z, 2026-03-28T05:00Z and 2026-03-29T04:00Z; with complete hourly data n is 24, 23 and 24.
Through octo-cli
octo-cli -c ListRollupsForArchive -id <archiveRtId> ends each rollup line with timeZone=<IANA id>, dayStart=<HH:mm> — a gas-day rollup reads timeZone=Europe/Vienna, dayStart=06:00. Older octo-cli versions print neither field, and an older asset repository does not report them (timeZone=<none>, dayStart=<none>). octo-cli does not create rollups; use a blueprint or createRollupArchive.
DST handling
A local day across a DST transition is 23 h or 25 h, never a fixed 24 h. Bucket boundaries are computed at civil boundaries, so a DST-day bucket is simply wider or narrower — never split, never duplicated. Example, Europe/Vienna:
| Day | Local start → end | UTC window | Length |
|---|---|---|---|
| 2026-03-29 (spring forward) | 00:00 CET → 00:00 CEST | 2026-03-28T23:00Z → 2026-03-29T22:00Z | 23 h |
| 2026-06-15 (no transition) | 00:00 CEST → 00:00 CEST | 2026-06-14T22:00Z → 2026-06-15T22:00Z | 24 h |
| 2026-10-25 (fall back) | 00:00 CEST → 00:00 CET | 2026-10-24T22:00Z → 2026-10-25T23:00Z | 25 h |
Client-side relative ranges
Dashboards resolve relative ranges (this year / this month / a picked day) to an absolute [from, to) window before sending them to the backend. That resolution must happen in the chosen IANA zone, not the browser's own zone — otherwise "yesterday in Europe/Lisbon" is wrong when viewed from a Vienna browser.
TimeRangeUtils (shared UI) resolves year / quarter / month / day / custom boundaries for an arbitrary IANA zone, DST-correctly and independent of the browser, using native Intl — no extra dependency. Passing 'local' or 'utc' keeps the historical behaviour.
// Same civil day, two zones → two different UTC windows (one hour apart):
TimeRangeUtils.getDayRange(2026, 5, 15, undefined, undefined, 'Europe/Vienna');
// from 2026-06-14T22:00:00Z (CEST, UTC+2)
TimeRangeUtils.getDayRange(2026, 5, 15, undefined, undefined, 'Europe/Lisbon');
// from 2026-06-14T23:00:00Z (WEST, UTC+1)
Storage is unchanged
Rows stay in UTC; the time zone is a query-time concern only. Nothing is double-bucketed, and no timezone metadata is backfilled onto historical rows.
Status & limitations
- Backend read-path (resolver
timeZone+comparisonPolicy, GraphQL + MCP) and the DST-correct civil-day resolution inTimeRangeUtilsare implemented. - Day starts other than midnight (gas days) are available through GraphQL:
createRollupArchive.dayStartOffsetMs,resolveSeriesQuery.dayStartOffsetMs/binOriginand the local-day bins of the transient downsampling query, also one row per series (groupByColumnPaths: ["rtId"]). Persisted downsampling queries and the pipeline query node always use midnight days. - MeshBoards support an explicit per-board IANA zone end to end: the Time Filter tab offers Local / UTC / Specific time zone (a filterable IANA dropdown), and the chosen zone drives both the civil-day range and, for resolution-aware stream-data widgets, the
timeZonesent toresolveSeriesQuery. See the MeshBoard timezone guide. comparisonPolicydefaults toPerQuery;PerSeriesis reachable through the GraphQL/MCP API but has no dedicated board toggle yet.- Cascade calendar rollups (a rollup sourced from another rollup, e.g. daily→weekly→monthly) are excluded from automatic selection in the current phase, independent of the time zone.