The trade date is what governs. Settlement (which can take up to 3 days from the time a stock is sold) usually only matters in cases of dividends where people need to be record holders as of a certain date. In that case, people who want to receive the dividends should buy 3 or more days before the date of record.