Skip to content

Main content

Time Zone Pair Offset Difference Table

Supplied synthetic civil-second offset observations only, no IANA database, DST rule inference or leap seconds; compare simultaneous supplied zone-span offsets only on explicit UTC intersections, preserving signed right-minus-left and every overlap occurrence.

Loading tool…

Description

Compare simultaneous supplied zone-span offsets only on explicit UTC intersections, preserving signed right-minus-left and every overlap occurrence.

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.

Compare simultaneous supplied zone-span offsets only on explicit UTC intersections, preserving signed right-minus-left and every overlap occurrence.

When to use this tool

Use this tool to compare simultaneous supplied zone-span offsets only on explicit UTC intersections, preserving signed right-minus-left and every overlap occurrence.

How to use the tool and how it works

  1. Enter leftJson, rightJson 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.pieces, using the stated boundary, ordering, sign and absence conventions.

Intersect every left/right UTC span pair using start=max(starts), end=min(ends). Keep start<end and report both source indexes and difference=right.offset−left.offset in left-major source order.1

Input fieldMeaning and unitsAccepted input
leftJsonJSON array of left {start,end,offset} spans in seconds; start<end, coordinates within ±10¹² and offset within ±86,400.Text, at most 8,192 UTF-16 code units; narrower grammar/range rules also apply.
rightJsonJSON array of right offset spans in the same shape, origin and units as leftJson.Text, at most 8,192 UTF-16 code units; narrower grammar/range rules also apply.

These decoded structures show the examples inside JSON text fields. Supply their serialized JSON strings as input.

json
{
  "leftJson": [
    {
      "start": 0,
      "end": 2,
      "offset": 1
    }
  ],
  "rightJson": [
    {
      "start": 1,
      "end": 3,
      "offset": 4
    }
  ]
}
Output fieldInterpretation
resultObject containing the fields below.
result.piecesPositive-length intersection pieces with the UTC/local endpoints, offsets and original indexes stated above.
json
{
  "input": {
    "leftJson": "[{\"start\":0,\"end\":2,\"offset\":1}]",
    "rightJson": "[{\"start\":1,\"end\":3,\"offset\":4}]"
  },
  "output": {
    "result": {
      "pieces": [
        {
          "left": 0,
          "right": 0,
          "start": 1,
          "end": 2,
          "difference": 3
        }
      ]
    }
  }
}

Limitations and assumptions

  • Touching boundaries have no positive-length intersection. Duplicate or overlapping observations remain separate pieces.
  • 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 Pair Offset Difference Table — tool.io

Similar or alternative tools