How do ex-dividend dates work?
When announcing an upcoming dividend payout, a company typically states that it will make a payment to shareholders of record as of a certain date. The ex-dividend date occurs one trading day before the record date. But buying a stock on its ex-dividend date will not make you a shareholder of record in time to qualify for the upcoming payout.
Because settling trades and updating records takes time, investors will actually need to own shares at the stock market's close two days prior to the record date to get the dividend. This means that if you are the owner of the stock when the market closes the day before the ex-dividend date, you will be locked in to receive the dividend on the previously specified payable date.