As a company declares the dividend data, it records when the company books will show shareholders' dividends.
The records mention three dates: the ex-dividend date, the date of record and the pay date. The ex-dividend date refers to two business days before the record date.
You will not get the dividend if you buy a stock on the ex-dividend dates (or later). It refers to the time phase between the announcement and payment of the money, while the date of record is when the shareholder must officially own the share to be entitled to the dividend.
The price of stocks gains before the date, and once the declaration of dividend is made, it declines.
Some investors use the term buying dividends, buying stocks before the date only to sell once the dividends are declared,d but this rarely works as it takes time for the shares to show up in your account.
For buying and selling,g you need to pay a commission, which makes such trades unprofitable.