AC 4121 then AY 5797 at San Francisco
Ontario → San Francisco → New York JFK
Timetable, San Francisco time
17:50AC 4121 from Ontario at the gate
12:25AY 5797 to New York JFK leaves the gate
18 h 35 apart on the timetable, overnight
AY 5797 leaves 18 h 35 after AC 4121 arrives on the timetable: more than half a day, so not a connection we count.