Description
Intersect UTC windows with every supplied offset span and map each piece independently into local coordinates; gaps/overlaps are not concealed.
An offset maps a supplied UTC coordinate to local civil coordinates by local = UTC + offset. Half-open spans include their start and exclude their end. A forward offset jump can leave local coordinates uncovered; a backward jump can give several UTC interpretations of one local value. These tools use explicit synthetic civil-second observations rather than a named-zone database.
Intersect UTC windows with every supplied offset span and map each piece independently into local coordinates; gaps/overlaps are not concealed.
When to use this tool
Use this tool to intersect UTC windows with every supplied offset span and map each piece independently into local coordinates; gaps/overlaps are not concealed.
How to use the tool and how it works
- Enter spansJson, start, end using the definitions below. Serialize JSON text fields in the decoded shape shown below.
- Run the operation. Resolve input-format errors before interpreting an output.
- Read result.pieces, using the stated boundary, ordering, sign and absence conventions.
Intersect the requested half-open UTC window with each supplied offset span. For every positive intersection return UTC endpoints and local endpoints obtained by adding that span’s offset, retaining its original index.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| spansJson | JSON array of {start,end,offset}: half-open UTC spans with local=UTC+offset, all in seconds. | Text, at most 8,192 UTF-16 code units; narrower grammar/range rules also apply. |
| start | Inclusive UTC or local window start in seconds, as explicitly stated by this operation. | Finite numeric value satisfying the stated comparisons. |
| end | Exclusive window end in seconds, on the same coordinate scale as start. | Finite numeric value satisfying the stated comparisons. |
These decoded structures show the examples inside JSON text fields. Supply their serialized JSON strings as input.
{
"spansJson": [
{
"start": 0,
"end": 10,
"offset": 0
},
{
"start": 10,
"end": 20,
"offset": 2
},
{
"start": 20,
"end": 30,
"offset": 0
}
]
} | Output field | Interpretation |
|---|---|
| result | Object containing the fields below. |
| result.pieces | Positive-length intersection pieces with the UTC/local endpoints, offsets and original indexes stated above. |
{
"input": {
"spansJson": "[{\"start\": 0, \"end\": 10, \"offset\": 0}, {\"start\": 10, \"end\": 20, \"offset\": 2}, {\"start\": 20, \"end\": 30, \"offset\": 0}]",
"start": 9,
"end": 11
},
"output": {
"result": {
"pieces": [
{
"index": 0,
"utcStart": 9,
"utcEnd": 10,
"localStart": 9,
"localEnd": 10,
"offset": 0
},
{
"index": 1,
"utcStart": 10,
"utcEnd": 11,
"localStart": 12,
"localEnd": 13,
"offset": 2
}
]
}
}
} Limitations and assumptions
- Input gaps and overlaps are preserved; the tool does not invent a continuous coverage or consult a real time-zone database.
- Span/transition coordinates are finite seconds within ±10¹² and offsets within ±86,400 seconds. Spans require start<end. No IANA database, calendar parsing, daylight-saving inference or leap seconds are included.
- Every declared outer field is required and unknown outer fields are rejected. Strings and JSON text have size limits, lists are bounded to 128 entries, and JSON nesting/node counts are bounded. Tighter operation-specific bounds stated above take precedence.
- Ordinary numeric outputs must be finite and within safe-integer magnitude. Exact large lengths/counts use decimal strings. Original record indexes and code-unit positions are zero-based; span ends are exclusive unless stated otherwise.
Alternative or Complementary methods
Keep all timestamps on one origin and in seconds, and retain gaps or competing observations. Use a maintained time-zone library when real dates, named zones or historical rules are required.
References
Similar or alternative tools
- Time Zone Local UTC Candidate List
Enumerate every offset-span UTC solution for a supplied local-second coordinate, retaining duplicates and overlapping evidence.
- Time Zone Local Window UTC Span List
Invert a local half-open window against every observed offset span, preserving multiple UTC solutions and source span indexes.