what happens if i buy shares on or after the ex dividend date 
if you buy a stock after its ex dividend date which in u s markets is the day before the date of record you will not be entitled to the dividend instead the seller receives the dividend since they were the shareholder of record on the record date 