{
  "address": "714d6ac92cd24a7700c5b04725a483ff",
  "category": "other",
  "question": "What is 2026-09-30 23:30:00 -05:00 converted to the +01:00 offset?",
  "answer": "2026-10-01 05:30:00 (+1 day)",
  "askedBy": {
    "kind": "guest",
    "display": "method deck",
    "stamped": false,
    "id": null
  },
  "answeredBy": "method",
  "madeAt": "2026-09-30T22:39:30.722Z",
  "validUntil": null,
  "validityClass": "forever",
  "sources": [
    {
      "label": "chrono-Compatible Low-Level Date Algorithms",
      "url": "https://howardhinnant.github.io/date_algorithms.html"
    }
  ],
  "supersedes": null,
  "supersededBy": null,
  "isSeed": false,
  "seedSource": null,
  "seedAttribution": null,
  "duplicateOfQid": null,
  "publishedAt": null,
  "unpublishedAt": null,
  "voteCount": 0,
  "queuedForSubstrate": false,
  "answerMethod": "method",
  "unsourced": false,
  "source": {
    "kind": "url",
    "value": "https://howardhinnant.github.io/date_algorithms.html",
    "retrieved_utc": "2026-09-30T19:41:35Z"
  },
  "qsha256": "01153325bb9c40a670d499a5328a94ccd3273b866aab9f886008504feaf149fd",
  "runOne": null,
  "cardContractVersion": "card_contract/1",
  "deck_id": "method-deck",
  "deck_title": "Method Deck",
  "method": {
    "name": "Convert a time between fixed UTC offsets",
    "version": "1",
    "source_url_or_file": "methods/convert-time-between-fixed-offsets.cjs",
    "sha256_of_method_file": "24e49d17c9d4dfcb419885620c4095d0fce5d0a065f281d541b3d3d38f7cd2ab"
  },
  "receipt": {
    "inSubstrate": false,
    "local": true,
    "modelCallsAtMint": 0,
    "tokensAtMint": 0
  },
  "method_deck": {
    "inputs": [
      {
        "name": "date",
        "type": "string",
        "format": "date",
        "required": true,
        "description": "ISO 8601 date of the source time, YYYY-MM-DD"
      },
      {
        "name": "time",
        "type": "string",
        "required": true,
        "description": "Source wall-clock time, HH:MM or HH:MM:SS (24-hour)"
      },
      {
        "name": "from_offset",
        "type": "string",
        "required": true,
        "description": "Fixed UTC offset of the source time, e.g. -05:00"
      },
      {
        "name": "to_offset",
        "type": "string",
        "required": true,
        "description": "Fixed UTC offset to convert into, e.g. +01:00"
      }
    ],
    "outputs": [
      {
        "name": "result_date",
        "format": "date",
        "description": "The resulting date in the target offset"
      },
      {
        "name": "result_time",
        "description": "The resulting wall-clock time in the target offset, HH:MM:SS"
      },
      {
        "name": "day_shift",
        "description": "0 if the result is the same calendar date, +1 if it rolled to the next date, -1 if it rolled to the previous date"
      }
    ],
    "steps": [
      "Parse date and time into a day-number (Hinnant days_from_civil, cited above) and seconds-since-midnight.",
      "Parse from_offset and to_offset as signed HH:MM offsets from UTC, in seconds.",
      "utc_seconds_total = day_number * 86400 + local_seconds - from_offset_seconds.",
      "target_seconds_total = utc_seconds_total + to_offset_seconds.",
      "result_day_number = floor(target_seconds_total / 86400); seconds_into_day = target_seconds_total - result_day_number * 86400.",
      "Convert result_day_number back to a civil date (civil_from_days) and seconds_into_day back to HH:MM:SS.",
      "day_shift = result_day_number - original_day_number."
    ],
    "constants": [],
    "examples": [
      {
        "name": "worked example",
        "inputs": {
          "date": "2026-09-30",
          "time": "23:30:00",
          "from_offset": "-05:00",
          "to_offset": "+01:00"
        },
        "expected": {
          "answer": "2026-10-01 05:30:00 (+1 day)"
        },
        "check": "the offset difference is +6 hours; 23:30 + 6:00 = 29:30, which is 05:30 the next day"
      },
      {
        "name": "test vector: rolls to the previous day",
        "inputs": {
          "date": "2026-01-01",
          "time": "00:15:00",
          "from_offset": "+09:00",
          "to_offset": "-08:00"
        },
        "expected": {
          "answer": "2025-12-31 07:15:00 (-1 day)"
        },
        "check": "the offset difference is -17 hours; 00:15 - 17:00 = -16:45, which is 07:15 the previous day"
      },
      {
        "name": "test vector: same day, no rollover",
        "inputs": {
          "date": "2026-06-15",
          "time": "10:00:00",
          "from_offset": "+00:00",
          "to_offset": "+02:00"
        },
        "expected": {
          "answer": "2026-06-15 12:00:00 (same day)"
        },
        "check": "the offset difference is +2 hours; 10:00 + 2:00 = 12:00, still the same calendar date"
      }
    ],
    "disclaimer": null,
    "deck_category": "timezones"
  },
  "status": "minted",
  "kind": "method",
  "provenanceClass": "own_question",
  "provenance": {
    "schema": "card_provenance/2.0.0",
    "chain": [
      {
        "source": {
          "kind": "url",
          "value": "https://howardhinnant.github.io/date_algorithms.html",
          "retrieved_utc": "2026-09-30T19:41:35Z"
        },
        "sha256": "432b950c6df256d84433a167057dae2344b9d78c5d9fc245d017178c356001ca",
        "supersedes": null,
        "added_utc": "2026-09-30T22:39:30.722Z",
        "added_by": "method:Convert a time between fixed UTC offsets",
        "why": "the method that computed this answer",
        "check": null,
        "status_label": "pending",
        "signature": null
      }
    ]
  }
}
