Skip to content

Main content

Time Zone Offset Span Coverage Gaps

Supplied synthetic civil-second offset observations only, no IANA database, DST rule inference or leap seconds; audit uncovered portions of a finite UTC window after unioning all supplied coverage regardless of offsets; not a claim of timezone rule completeness.

Loading tool…

Description

Audit uncovered portions of a finite UTC window after unioning all supplied coverage regardless of offsets; not a claim of timezone rule completeness.

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.

Audit uncovered portions of a finite UTC window after unioning all supplied coverage regardless of offsets; not a claim of timezone rule completeness.

When to use this tool

Use this tool to audit uncovered portions of a finite UTC window after unioning all supplied coverage regardless of offsets; not a claim of timezone rule completeness.

How to use the tool and how it works

  1. Enter spansJson, start, end using the definitions below. Serialize JSON text fields in the decoded shape shown below.
  2. Run the operation. Resolve input-format errors before interpreting an output.
  3. Read result.gaps, using the stated boundary, ordering, sign and absence conventions.

Sort a copy of spans by start, intersect with the half-open requested window, and advance a covered frontier through their union. Return every uncovered [start,end] interval.1

Input fieldMeaning and unitsAccepted input
spansJsonJSON 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.
startInclusive UTC or local window start in seconds, as explicitly stated by this operation.Finite numeric value satisfying the stated comparisons.
endExclusive 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.

json
{
  "spansJson": [
    {
      "start": 1,
      "end": 2,
      "offset": 0
    },
    {
      "start": 3,
      "end": 4,
      "offset": 0
    }
  ]
}
Output fieldInterpretation
resultObject containing the fields below.
result.gapsUncovered half-open UTC [start,end] intervals in increasing order.
json
{
  "input": {
    "spansJson": "[{\"start\":1,\"end\":2,\"offset\":0},{\"start\":3,\"end\":4,\"offset\":0}]",
    "start": 0,
    "end": 5
  },
  "output": {
    "result": {
      "gaps": [
        [
          0,
          1
        ],
        [
          2,
          3
        ],
        [
          4,
          5
        ]
      ]
    }
  }
}

Limitations and assumptions

  • Offsets do not affect coverage; conflicting overlapping offsets can cover the same UTC region without being resolved by this operation.
  • 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

  1. Tool behavior and example: Time Zone Offset Span Coverage Gaps — tool.io

Similar or alternative tools