I am trying to capture the daily closing price of the SPY using timecodes.

I have noticed by looking on the time&sales that the closing prices do not match up with the last trades before the 4pm bell.

For example: Today's last trade at 15:59:59 was 207.28, but the daily closing price was 207.26, which didn't first occur until almost 15 minutes later.

Just when exactly does the SPY's closing price occur? I cannot seem to find the answer anywhere.

Thanks!