W9 5738 then U2 804 at Gatwick
Valencia → London → Edinburgh
Timetable, London time
12:30W9 5738 from Valencia at the gate
10:45U2 804 to Edinburgh leaves the gate
22 h 15 apart on the timetable, overnight
U2 804 leaves 22 h 15 after W9 5738 arrives on the timetable: more than half a day, so not a connection we count.