W4 6459 then U2 3210 at Madrid
Milan → Madrid → Edinburgh
Timetable, Madrid time
18:30W4 6459 from Milan at the gate
16:30U2 3210 to Edinburgh leaves the gate
22 h apart on the timetable, overnight
U2 3210 leaves 22 h after W4 6459 arrives on the timetable: more than half a day, so not a connection we count.