{
  "address": "1a135c4eaff94ccb876a7f71fc5a357d",
  "category": "other",
  "question": "Departing 2026-09-30 08:00:00 -05:00 and arriving 2026-09-30 21:35:00 +01:00, how long was the flight?",
  "answer": "7h 35m",
  "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": "7847891b877712496f4337674ec605a9db4d6d40a96594463f3e851db60e4530",
  "runOne": null,
  "cardContractVersion": "card_contract/1",
  "deck_id": "method-deck",
  "deck_title": "Method Deck",
  "method": {
    "name": "Flight duration across time zones",
    "version": "1",
    "source_url_or_file": "methods/flight-duration-across-zones.cjs",
    "sha256_of_method_file": "bac6ae55771be31f50c744cb731431c2f7319b904ab49f1dbf900d6d29fa14b2"
  },
  "receipt": {
    "inSubstrate": false,
    "local": true,
    "modelCallsAtMint": 0,
    "tokensAtMint": 0
  },
  "method_deck": {
    "inputs": [
      {
        "name": "departure_date",
        "type": "string",
        "format": "date",
        "required": true,
        "description": "ISO 8601 departure date, YYYY-MM-DD, local to departure_offset"
      },
      {
        "name": "departure_time",
        "type": "string",
        "required": true,
        "description": "Departure local wall-clock time, HH:MM or HH:MM:SS"
      },
      {
        "name": "departure_offset",
        "type": "string",
        "required": true,
        "description": "Fixed UTC offset at departure, e.g. -05:00"
      },
      {
        "name": "arrival_date",
        "type": "string",
        "format": "date",
        "required": true,
        "description": "ISO 8601 arrival date, YYYY-MM-DD, local to arrival_offset"
      },
      {
        "name": "arrival_time",
        "type": "string",
        "required": true,
        "description": "Arrival local wall-clock time, HH:MM or HH:MM:SS"
      },
      {
        "name": "arrival_offset",
        "type": "string",
        "required": true,
        "description": "Fixed UTC offset at arrival, e.g. +01:00"
      }
    ],
    "outputs": [
      {
        "name": "hours",
        "description": "Whole hours of elapsed time"
      },
      {
        "name": "minutes",
        "description": "Remaining minutes of elapsed time"
      }
    ],
    "steps": [
      "Parse the departure date, time and offset into a single UTC instant, in seconds: day-number (Hinnant days_from_civil, cited above) times 86400, plus local seconds-since-midnight, minus the offset in seconds.",
      "Do the same for the arrival date, time and offset to get the arrival UTC instant.",
      "elapsed_seconds = arrival_utc_instant - departure_utc_instant; require this to be positive.",
      "hours = floor(elapsed_seconds / 3600); minutes = floor((elapsed_seconds mod 3600) / 60)."
    ],
    "constants": [],
    "examples": [
      {
        "name": "worked example",
        "inputs": {
          "departure_date": "2026-09-30",
          "departure_time": "08:00:00",
          "departure_offset": "-05:00",
          "arrival_date": "2026-09-30",
          "arrival_time": "21:35:00",
          "arrival_offset": "+01:00"
        },
        "expected": {
          "answer": "7h 35m"
        },
        "check": "08:00 -05:00 is 13:00 UTC; 21:35 +01:00 is 20:35 UTC; 20:35 minus 13:00 is 7 hours 35 minutes"
      },
      {
        "name": "test vector: overnight, crosses a calendar date",
        "inputs": {
          "departure_date": "2026-03-01",
          "departure_time": "22:00:00",
          "departure_offset": "-05:00",
          "arrival_date": "2026-03-02",
          "arrival_time": "11:30:00",
          "arrival_offset": "+01:00"
        },
        "expected": {
          "answer": "7h 30m"
        },
        "check": "22:00 -05:00 on Mar 1 is 03:00 UTC Mar 2; 11:30 +01:00 on Mar 2 is 10:30 UTC Mar 2; 10:30 minus 03:00 is 7 hours 30 minutes"
      },
      {
        "name": "test vector: both local times identical but different offsets",
        "inputs": {
          "departure_date": "2026-05-01",
          "departure_time": "09:00:00",
          "departure_offset": "+09:00",
          "arrival_date": "2026-05-01",
          "arrival_time": "09:00:00",
          "arrival_offset": "-08:00"
        },
        "expected": {
          "answer": "17h 0m"
        },
        "check": "09:00 +09:00 is 00:00 UTC; 09:00 -08:00 is 17:00 UTC on the same UTC date; 17:00 minus 00:00 is 17 hours"
      }
    ],
    "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": "f71de8e62a45577f2b19d9289b852caa86a74660b2ba85fcbeb814c1ebbaff85",
        "supersedes": null,
        "added_utc": "2026-09-30T22:39:30.722Z",
        "added_by": "method:Flight duration across time zones",
        "why": "the method that computed this answer",
        "check": null,
        "status_label": "pending",
        "signature": null
      }
    ]
  }
}
