When does the sun set here? Skydex finally knows

· weather · flight · seo

The weather readout in the flight HUD has been able to answer a surprising number of questions for a while now. How warm is it over the city below. How hard is the wind blowing and from where. Whether the gusts make the next hour a bad idea for a light quad. What the next seven days look like, hour by hour, with a fly / don't-fly verdict on every row.

It could not answer the simplest question a pilot asks: how much light do I have left?

Nobody had asked the sun

The gap was not an oversight in the weather integration so much as a category error. We treated daylight as weather, and weather comes from Open-Meteo, and Open-Meteo's model chunks — temperature, cloud cover, precipitation, wind components — have nothing to say about where the sun is. So the question was never asked, and the places that needed an answer invented one.

There were four of those places, and each invented a different answer. The weather reading marked itself as daytime between 06:00 and 21:00 local. The condition glyph in the HUD switched to a moon before 06:00 and from 20:00 — one hour out of step with the flag right next to it. A ship card recorded that it was caught "at night" before 05:00 or from 21:00, computed from longitude alone. An aircraft card used a copy of that same rule.

At the equator those guesses are roughly right. Anywhere with seasons they are wrong for months at a time. A catch at 21:30 over Hamburg in June — sun still a good five degrees up, the harbour lit orange — was filed as a night catch and paid the night bonus. A genuinely pitch-black 04:30 in December was filed as day and paid nothing. Above the Arctic circle the whole idea collapses: there are weeks where the local hour tells you nothing at all, because the sun does not set.

One function, one definition

Sunrise and sunset are geometry. The flight simulator has been doing that geometry all along — the day/night cycle in the sky positions a real sun from your latitude, longitude and the clock, and always has. What was missing was nobody had ever asked it for the moment the sun crosses the horizon.

Now they do. The same solar-position code is root-found for the crossing of −0°50′, the standard horizon that every almanac uses (the sun's upper limb, plus the refraction that bends it into view before it is geometrically up). The result is checked against the NOAA reference formulas at nine places from Quito to Svalbard and agrees within half a minute everywhere.

That one function is now the single definition of night in the product. The weather reading's day flag, the sun-or-moon glyph, the night bonus on a ship card, the night bonus on an aircraft card: all four ask it, and all four now agree with each other and with the sky outside your window.

Cards minted under the old rule keep the flag and the experience they were given. A data fix does not revisit a payout — that rule has served us well and it applies here too.

Where you'll see it

In the flight HUD, the live line now carries the next sun event: a sunrise glyph and a time when it is dark, a sunset glyph and a time when it is light. Only the next one, because the question in the air is always "how long have I got", never "recite both". It shows as soon as the city's timezone is known and does not wait for a weather reading, because it never depended on one.

Open the forecast panel and today's daylight window sits above the hourly strip: sunrise, sunset, and the length of the day. The hourly rows now pick their sun or moon from that day's real crossings, so a 21:00 row is a sun in June and a moon in December instead of always being the same glyph.

On the city landing pages — the roughly 775 that carry live flying conditions — there is a new line under the verdict: Sunrise 04:50 · Sunset 21:53 · 17 h 03 m of daylight (local time). Unlike the forecast above it, that line never really goes stale: sunrise moves a couple of minutes a day and comes from coordinates rather than a model run, so the copy baked into the page is as good as the copy your browser fetches.

And if you ask the public API for a city's weather, every day of the forecast now carries its own sunrise, sunset and daylight length, in absolute time, DST switches inside the week handled properly.

Polar cases are named rather than faked. A day with no crossing does not print a time it invented — it says polar night or midnight sun, which is both shorter and true.

More from Skydex

Play Skydex free →