U2 866 then BA 2642 at Gatwick
Glasgow → London → Málaga
Timetable, London time
15:55U2 866 from Glasgow at the gate
14:35BA 2642 to Málaga leaves the gate
22 h 40 apart on the timetable, overnight
BA 2642 leaves 22 h 40 after U2 866 arrives on the timetable: more than half a day, so not a connection we count.