SunSchedule
Observing Session Overlap with a Supplied Darkness Window Calculator
Calculate how much of an observing session falls within a darkness window you supply, using dates, times and explicit UTC offsets.
Enter the start and end of one observing session and one continuous darkness window. The calculator returns their shared elapsed time. You supply the darkness boundaries; this tool does not calculate twilight or determine whether the sky is dark.
Include a full date, seconds and an explicit UTC offset for every entry, for example 2026-11-11T21:00:00+00:00. For a window crossing midnight, use the following date for its end. Use the correct offset at each endpoint, including any daylight-saving change. No timezone is inferred.
The defaults are illustrative inputs, not predicted darkness times for any location.
The overlap runs from the later start to the earlier end. Its duration is the greater of zero and the elapsed time between those boundaries. Explicit offsets place all four endpoints on the same timeline.
With the example inputs, the shared interval is 22:00 to 02:00 the next day: 4 hours, or 14,400 seconds. Disjoint intervals, intervals that only touch at an endpoint, and valid zero-length intervals return zero. An end earlier than its own start produces an unavailable result (invalid_interval); it is not treated as zero overlap or automatically moved to the next day. Dependent results are also unavailable.
Decimal hours are rounded to three decimal places. Display precision does not improve the accuracy of your supplied boundaries.
This calculation assumes one uninterrupted session and one uninterrupted darkness window. Choose boundaries that match your intended definition of darkness and observing location. It does not infer darkness from sunset, calculate astronomical twilight, or account for clouds, moonlight, light pollution, obstructions or target visibility.
The result measures overlap with your supplied window, not guaranteed usable observing time. Incorrect dates, offsets or darkness estimates carry through to the result. Separate sessions or interrupted windows require separate calculations; avoid double-counting overlapping intervals.