Intersect Time Intervals

date-time · N112 · starter-package 7.0.1

Intersect two half-open time intervals. Touching endpoints have no overlap. Interval contains start and end DateTime values when they overlap, or an empty record otherwise.

Example

The ISO timestamps below are the values carried by DateTime connections. Connect the output of Parse Date or Create DateTime.

{"startA":"2024-01-01T00:00:00.000Z","endA":"2024-01-05T00:00:00.000Z","startB":"2024-01-03T00:00:00.000Z","endB":"2024-01-07T00:00:00.000Z"}

Result

{"overlaps":true,"interval":{"start":"2024-01-03T00:00:00.000Z","end":"2024-01-05T00:00:00.000Z"},"milliseconds":172800000}

Connector data types

DirectionConnectorTypeRequired
InputstartA — Start Adatetimeyes
InputendA — End Adatetimeyes
InputstartB — Start Bdatetimeyes
InputendB — End Bdatetimeyes
Outputoverlaps — Overlapsbooleanon success
Outputinterval — Intervalrecordon success
Outputmilliseconds — Millisecondsnumberon success

Errors and recovery

Connect four DateTime values. Each ending instant must be at or after the corresponding start. Adjacent intervals yield zero shared milliseconds.