Skip to content

Main content

Time Zone Local Candidate Policy Selector

Supplied synthetic civil-second offset observations only, no IANA database, DST rule inference or leap seconds; choose earliest/latest UTC candidate or unique-only under an explicit policy; empty or unresolved evidence returns null.

Loading tool…

Description

Choose earliest/latest UTC candidate or unique-only under an explicit policy; empty or unresolved evidence returns null.

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.

Choose earliest/latest UTC candidate or unique-only under an explicit policy; empty or unresolved evidence returns null.

When to use this tool

Use this tool to choose earliest/latest UTC candidate or unique-only under an explicit policy; empty or unresolved evidence returns null.

How to use the tool and how it works

  1. Enter spansJson, local, policy 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.selected, result.candidateCount, using the stated boundary, ordering, sign and absence conventions.

Build every local-to-UTC candidate and sort by UTC, then original span index. earliest selects the first, latest the last, and unique selects only when exactly one occurrence exists; otherwise selected=null. Return candidateCount separately.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.
localLocal civil-second coordinate within ±10¹².Finite numeric value satisfying the stated comparisons.
policyExact candidate policy: earliest, latest or unique.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
{
  "spansJson": [
    {
      "start": 0,
      "end": 10,
      "offset": 0
    },
    {
      "start": 10,
      "end": 20,
      "offset": 2
    },
    {
      "start": 20,
      "end": 30,
      "offset": 0
    }
  ]
}
Output fieldInterpretation
resultObject containing the fields below.
result.selectedCandidate chosen by the explicit policy, or null if none qualifies.
result.candidateCountNumber of candidate occurrences, including duplicate equivalent interpretations.
json
{
  "input": {
    "spansJson": "[{\"start\": 0, \"end\": 10, \"offset\": 0}, {\"start\": 10, \"end\": 20, \"offset\": 2}, {\"start\": 20, \"end\": 30, \"offset\": 0}]",
    "local": 21,
    "policy": "earliest"
  },
  "output": {
    "result": {
      "selected": {
        "index": 1,
        "utc": 19,
        "offset": 2
      },
      "candidateCount": 2
    }
  }
}

Limitations and assumptions

  • Equal UTC candidates from duplicate spans still count as multiple occurrences and can make the unique policy reject selection.
  • 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 Local Candidate Policy Selector — tool.io

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 Ambiguity Classifier

    Classify supplied local candidates without claiming missing evidence proves a real civil-clock gap; repeated/overlapping observations remain ambiguous.