{"skills":[{"name":"Calculate flight durations across time zones","description":"Put each flight on a common timeline while preserving local departure and arrival dates, including next-day arrivals and repeated clock times.","content":"# Calculate flight durations across time zones\n\nPut each flight on a common timeline while preserving local departure and arrival dates, including next-day arrivals and repeated clock times.\n\n## When to use this skill\n\n- An itinerary shows arrival on the next day or the day before, and the person wants the real flight time.\n- Someone is planning a connection or a pick-up and needs every departure and arrival on one timeline.\n- A flight departs or arrives on a night when the clocks change.\n\n## When not to use it\n\n- Live flight status, delays or actual departure times. Check the airline or airport.\n- Judging whether a connection leaves enough time at the airport. Use the self-transfer skill for separate tickets, or the airline's minimum connection time on one ticket.\n\n## What you need\n\n- Each flight's local departure and arrival dates and times with IANA time zones or explicit numeric UTC offsets.\n- The itinerary's +1 or +2 date markers and any information distinguishing repeated local times when daylight saving ends.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Does the ticket print a UTC offset, or only the airport? With only the airport, the time zone and its rule on that date are needed.\n- Is the arrival date printed in full, or only as a +1 or -1 marker?\n- For a time during a clock change, does the airline give the UTC time, or say which of the repeated times it means?\n\n## Method\n\n1. Keep the printed local dates, times and airports as evidence. Work out the arrival date first: apply a +1, +2 or -1 marker to the departure date, or use the printed arrival date. If both appear, check they agree instead of adding the marker twice.\n2. Use an explicit UTC offset when the ticket prints one. Otherwise find the airport's IANA time zone and its offset on that date from the time zone database.\n3. Check that the local time exists and is unique on that date. UK clocks go back at 2am on the last Sunday in October, so 01:00 to 01:59 happens twice; US clocks jump from 2am to 3am on the second Sunday in March, so 02:00 to 02:59 does not exist. Other countries have their own rules. Flag an ambiguous or skipped time and ask for the offset or corrected time.\n4. Convert departure and arrival to UTC and subtract to get elapsed minutes. Never subtract the printed clock times. Call the result scheduled elapsed time unless actual times were given.\n5. Keep any endpoint that resolves even when the other does not, and leave the duration empty until both are known.\n6. For connecting legs, compare each departure in UTC with the previous arrival in UTC. A negative duration or a departure before the previous arrival points to a date or zone error; flag it and keep the printed evidence.\n\n## Checks before you deliver\n\n- Crossing the date line can produce a local arrival date earlier than departure.\n- A repeated 01:30 during a clock change can identify two different real instants.\n- Subtracting the printed local times, which is wrong whenever the airports are in different zones.\n- Using a summer offset for a winter flight, or the reverse, instead of the offset on the travel date.\n- Adding a +1 marker to an arrival date that already includes it, which puts the arrival a day late.\n\n## How to present the result\n\nLead with each flight's elapsed time in hours and minutes. Then give a table per leg: printed local departure and arrival with zone or offset, UTC departure and arrival, duration and any issue. For a flagged time, say exactly what to ask the airline, such as the UTC time or which of the repeated clock times is meant.\n\n## Worked example\n\n**Request:** Work out elapsed flight time from this booking.\n\n**Supplied material:**\n\n```text\nF8 departs 2026-07-02 21:20 -04:00. Arrival printed 09:05 +1 local, +01:00.\n```\n\n**Answer:** F8\u2019s scheduled journey takes 6 hours 45 minutes. The schedule shows departure at 01:20 UTC and arrival at 08:05 UTC on 3 July. The printed 09:05 arrival is local time on the next calendar day.\n\n## Structured output for tests\n\nFor an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.\n\nFor each leg ID return depart_utc, arrive_utc (ISO YYYY-MM-DDTHH:MMZ or null), duration_min (integer or null), and issue ('ambiguous-local-time', 'nonexistent-local-time', 'invalid-order', 'missing-zone' or null). Use null for a negative duration. Preserve known endpoints when only the other endpoint is unresolved.\n\n## Sources\n\n- [IANA time zone database](https:\/\/www.iana.org\/time-zones): The database records the history and future rules of UTC offsets and daylight saving for locations worldwide, and software uses it to find a place's offset on a given date. The skill relies on it for named zones when the ticket prints no offset.\n- [GOV.UK: when do the clocks change?](https:\/\/www.gov.uk\/when-do-the-clocks-change): UK clocks go forward at 1am on the last Sunday in March and back at 2am on the last Sunday in October, which in 2026 are 29 March and 25 October. This is why 01:30 on 25 October 2026 in London is ambiguous.\n- [NIST: daylight saving time](https:\/\/www.nist.gov\/pml\/time-and-frequency-division\/popular-links\/daylight-saving-time-dst): The US National Institute of Standards and Technology states that daylight saving time begins at 2:00 a.m. local time on the second Sunday in March, when clocks jump to 3:00 a.m., and ends at 2:00 a.m. on the first Sunday in November. This is why 02:30 on 8 March 2026 in New York does not exist.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/normalise-flight-itinerary-times\n","scope":"contextual","trigger_keywords":["Calculate flight durations across time zones","normalise-flight-itinerary-times","normalise flight itinerary times","How long is this flight really, once the time zones are taken into account?","How long is this flight really, once the time zones are taken into account","flight itinerary times","flight times in utc","flight arrival date"],"is_private":true,"is_active":true,"scripts":[{"name":"normalise-flight-itinerary-times-check","description":"Compare a saved JSON answer with a published test. Pass tests\/case-1\/expected.json (or another case) and the path to your answer.","language":"python","filename":"normalise-flight-itinerary-times-check.py","content":"from pathlib import Path\nimport runpy\n\nrunpy.run_path(str(Path(__file__).parent \/ 'tests' \/ 'check.py'), run_name='__main__')\n","supporting_files":[{"path":"SKILL.md","content":"---\nname: normalise-flight-itinerary-times\ndescription: \"Convert each flight's printed local departure and arrival times to UTC using the offset or time zone on that date, then work out elapsed times and connection gaps, flagging next-day arrivals and clock-change times. Use when someone asks how long a flight really takes or why an arrival date looks wrong.\"\nlicense: CC-BY-4.0\nmetadata:\n  author: Raq.com\n  version: \"2026-11-22\"\n  homepage: https:\/\/skills.raq.com\/skills\/normalise-flight-itinerary-times\n---\n\n# Calculate flight durations across time zones\n\nPut each flight on a common timeline while preserving local departure and arrival dates, including next-day arrivals and repeated clock times.\n\n## When to use this skill\n\n- An itinerary shows arrival on the next day or the day before, and the person wants the real flight time.\n- Someone is planning a connection or a pick-up and needs every departure and arrival on one timeline.\n- A flight departs or arrives on a night when the clocks change.\n\n## When not to use it\n\n- Live flight status, delays or actual departure times. Check the airline or airport.\n- Judging whether a connection leaves enough time at the airport. Use the self-transfer skill for separate tickets, or the airline's minimum connection time on one ticket.\n\n## What you need\n\n- Each flight's local departure and arrival dates and times with IANA time zones or explicit numeric UTC offsets.\n- The itinerary's +1 or +2 date markers and any information distinguishing repeated local times when daylight saving ends.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Does the ticket print a UTC offset, or only the airport? With only the airport, the time zone and its rule on that date are needed.\n- Is the arrival date printed in full, or only as a +1 or -1 marker?\n- For a time during a clock change, does the airline give the UTC time, or say which of the repeated times it means?\n\n## Method\n\n1. Keep the printed local dates, times and airports as evidence. Work out the arrival date first: apply a +1, +2 or -1 marker to the departure date, or use the printed arrival date. If both appear, check they agree instead of adding the marker twice.\n2. Use an explicit UTC offset when the ticket prints one. Otherwise find the airport's IANA time zone and its offset on that date from the time zone database.\n3. Check that the local time exists and is unique on that date. UK clocks go back at 2am on the last Sunday in October, so 01:00 to 01:59 happens twice; US clocks jump from 2am to 3am on the second Sunday in March, so 02:00 to 02:59 does not exist. Other countries have their own rules. Flag an ambiguous or skipped time and ask for the offset or corrected time.\n4. Convert departure and arrival to UTC and subtract to get elapsed minutes. Never subtract the printed clock times. Call the result scheduled elapsed time unless actual times were given.\n5. Keep any endpoint that resolves even when the other does not, and leave the duration empty until both are known.\n6. For connecting legs, compare each departure in UTC with the previous arrival in UTC. A negative duration or a departure before the previous arrival points to a date or zone error; flag it and keep the printed evidence.\n\n## Checks before you deliver\n\n- Crossing the date line can produce a local arrival date earlier than departure.\n- A repeated 01:30 during a clock change can identify two different real instants.\n- Subtracting the printed local times, which is wrong whenever the airports are in different zones.\n- Using a summer offset for a winter flight, or the reverse, instead of the offset on the travel date.\n- Adding a +1 marker to an arrival date that already includes it, which puts the arrival a day late.\n\n## How to present the result\n\nLead with each flight's elapsed time in hours and minutes. Then give a table per leg: printed local departure and arrival with zone or offset, UTC departure and arrival, duration and any issue. For a flagged time, say exactly what to ask the airline, such as the UTC time or which of the repeated clock times is meant.\n\n## Worked example\n\n**Request:** Work out elapsed flight time from this booking.\n\n**Supplied material:**\n\n```text\nF8 departs 2026-07-02 21:20 -04:00. Arrival printed 09:05 +1 local, +01:00.\n```\n\n**Answer:** F8\u2019s scheduled journey takes 6 hours 45 minutes. The schedule shows departure at 01:20 UTC and arrival at 08:05 UTC on 3 July. The printed 09:05 arrival is local time on the next calendar day.\n\n## Structured output for tests\n\nFor an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.\n\nFor each leg ID return depart_utc, arrive_utc (ISO YYYY-MM-DDTHH:MMZ or null), duration_min (integer or null), and issue ('ambiguous-local-time', 'nonexistent-local-time', 'invalid-order', 'missing-zone' or null). Use null for a negative duration. Preserve known endpoints when only the other endpoint is unresolved.\n\n## Sources\n\n- [IANA time zone database](https:\/\/www.iana.org\/time-zones): The database records the history and future rules of UTC offsets and daylight saving for locations worldwide, and software uses it to find a place's offset on a given date. The skill relies on it for named zones when the ticket prints no offset.\n- [GOV.UK: when do the clocks change?](https:\/\/www.gov.uk\/when-do-the-clocks-change): UK clocks go forward at 1am on the last Sunday in March and back at 2am on the last Sunday in October, which in 2026 are 29 March and 25 October. This is why 01:30 on 25 October 2026 in London is ambiguous.\n- [NIST: daylight saving time](https:\/\/www.nist.gov\/pml\/time-and-frequency-division\/popular-links\/daylight-saving-time-dst): The US National Institute of Standards and Technology states that daylight saving time begins at 2:00 a.m. local time on the second Sunday in March, when clocks jump to 3:00 a.m., and ends at 2:00 a.m. on the first Sunday in November. This is why 02:30 on 8 March 2026 in New York does not exist.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/normalise-flight-itinerary-times\n"},{"path":"LICENSE.txt","content":"Original Raq.com instructions and synthetic examples: CC BY 4.0.\nhttps:\/\/creativecommons.org\/licenses\/by\/4.0\/\nAttribution: Raq.com, https:\/\/skills.raq.com\/skills\/normalise-flight-itinerary-times\nReferenced third-party materials retain their own terms.\n"},{"path":"examples\/worked-example.md","content":"# Next-day arrival\n\nWork out elapsed flight time from this booking.\n\n## Supplied material\n\nF8 departs 2026-07-02 21:20 -04:00. Arrival printed 09:05 +1 local, +01:00.\n\n## Worked answer\n\nF8\u2019s scheduled journey takes 6 hours 45 minutes. The schedule shows departure at 01:20 UTC and arrival at 08:05 UTC on 3 July. The printed 09:05 arrival is local time on the next calendar day.\n\n## Reasoning\n\nThe scheduled clock times differ by much more than the six hours and 45 minutes elapsed.\n"},{"path":"tests\/check.py","content":"\"\"\"Check a saved agent answer locally with Python 3 (standard library only).\"\"\"\nimport json\nimport math\nimport sys\nfrom pathlib import Path\n\n\ndef compare(expected, actual, path=\"$\", accepted=None):\n    if isinstance(expected, bool) or isinstance(actual, bool):\n        if expected is not actual:\n            yield path\n    elif isinstance(expected, (int, float)) and isinstance(actual, (int, float)):\n        if not math.isclose(expected, actual, rel_tol=0, abs_tol=1e-8):\n            yield path\n    elif isinstance(expected, dict) and isinstance(actual, dict):\n        for key in sorted(set(expected) | set(actual)):\n            if key not in expected or key not in actual:\n                yield f\"{path}.{key}\"\n            elif not any(\n                not list(compare(option, actual[key]))\n                for option in (accepted or {}).get(key, [])\n            ):\n                yield from compare(expected[key], actual[key], f\"{path}.{key}\")\n    elif isinstance(expected, list) and isinstance(actual, list):\n        if len(expected) != len(actual):\n            yield f\"{path} (length)\"\n        for i, (left, right) in enumerate(zip(expected, actual)):\n            yield from compare(left, right, f\"{path}[{i}]\")\n    elif type(expected) != type(actual) or expected != actual:\n        yield path\n\n\ndef main():\n    if len(sys.argv) != 3:\n        raise SystemExit(\"Usage: python3 check.py expected.json answer.json\")\n    try:\n        expected, actual = [json.loads(Path(p).read_text(encoding=\"utf-8\")) for p in sys.argv[1:]]\n        alternatives = Path(sys.argv[1]).with_name(\"accepted.json\")\n        accepted = json.loads(alternatives.read_text(encoding=\"utf-8\")) if alternatives.is_file() else {}\n    except (ValueError, OSError) as error:\n        raise SystemExit(str(error))\n    differences = list(compare(expected, actual, accepted=accepted))\n    if differences:\n        raise SystemExit(\"Different fields: \" + \", \".join(differences))\n    print(\"Pass\")\n\n\nif __name__ == \"__main__\":\n    main()\n"},{"path":"tests\/README.md","content":"Give your agent SKILL.md and one request.txt in a fresh session. Keep the expected answer aside. Save the reply as answer.json, then run this from the tests folder:\n\n    python3 check.py case-1\/expected.json answer.json\n\nEach case also has an explanation. Where accepted.json exists, the checker accepts the alternatives listed there.\n"},{"path":"tests\/case-1\/request.txt","content":"Work out elapsed flight time from this booking.\nReturn only the JSON specified in SKILL.md for this test.\n\nF8 departs 2026-07-02 21:20 -04:00. Arrival printed 09:05 +1 local, +01:00.\n"},{"path":"tests\/case-1\/expected.json","content":"{\n    \"F8\": {\n        \"depart_utc\": \"2026-07-03T01:20Z\",\n        \"arrive_utc\": \"2026-07-03T08:05Z\",\n        \"duration_min\": 405,\n        \"issue\": null\n    }\n}\n"},{"path":"tests\/case-1\/explanation.txt","content":"The scheduled clock times differ by much more than the six hours and 45 minutes elapsed.\n"},{"path":"tests\/case-2\/request.txt","content":"Which part of this itinerary can be timed precisely?\nReturn only the JSON specified in SKILL.md for this test.\n\nJ7 departs Europe\/London 2026-10-25 01:30, no offset printed. It arrives 2026-10-25 04:00 +00:00.\n"},{"path":"tests\/case-2\/expected.json","content":"{\n    \"J7\": {\n        \"depart_utc\": null,\n        \"arrive_utc\": \"2026-10-25T04:00Z\",\n        \"duration_min\": null,\n        \"issue\": \"ambiguous-local-time\"\n    }\n}\n"},{"path":"tests\/case-2\/explanation.txt","content":"The UK clock change repeats that departure time. The arrival remains unambiguous.\n"},{"path":"tests\/case-3\/request.txt","content":"Calculate elapsed time if the schedule identifies actual instants.\nReturn only the JSON specified in SKILL.md for this test.\n\nF2 departure 2026-03-08 02:30 America\/New_York, no UTC offset. Arrival 2026-03-08 10:00 +00:00.\n"},{"path":"tests\/case-3\/expected.json","content":"{\n    \"F2\": {\n        \"depart_utc\": null,\n        \"arrive_utc\": \"2026-03-08T10:00Z\",\n        \"duration_min\": null,\n        \"issue\": \"nonexistent-local-time\"\n    }\n}\n"},{"path":"tests\/case-3\/explanation.txt","content":"The clock advanced past 02:30 in New York. The arrival is still known; seek the corrected departure.\n"}],"is_active":true,"is_approved":false}]}]}