Suppose I have a stock ABC of 1000 shares whose ex-dividend date is May 20 (Wednesday) and I sell 500 shares after the market closes on May 19 (Tuesday) during the extended hours of trading, say at 4:14pm EST. Do I still get the dividend for 1000 shares? Or just for 500 shares?
Similarly, if I instead bought 800 shares on May 19 (Tuesday) after 4pm, say at 4:14pm, will I get dividend for the 1800 shares or just 1000 shares?
In addition, is buying/selling before 9:30 am on May 20 during the extended hours, say at 9:18am making any difference?