Ex-dividend date
Each dividend payment has four relevant dates. The declaration date is when the company announces the dividend. The ex-dividend date is the cutoff: to receive this payment, a buyer must have owned the shares before the ex-date (equivalently, a seller must have sold on or after it). The record date is the date the company checks its shareholder register. The payment date is when the cash actually hits accounts — usually two to four weeks after the ex-date.
On the ex-dividend date, the share price typically drops by roughly the dividend amount at the open — reflecting that anyone buying that day is no longer buying the rights to the upcoming payment. This isn't a loss for the existing holder: they simply receive the cash instead of the equivalent share-price component.
For investors with settlement-based brokers the practical rule is: the ex-date is the ownership cutoff, and it's determined by the exchange, not the brokerage. Trying to buy "for the dividend" the day before the ex-date works; buying on or after the ex-date does not.