The ex-dividend date is the date that determines whether you are eligible to receive an upcoming dividend.
If you buy the shares on or after the ex-dividend date, you will generally not receive that dividend. To be eligible, you usually need to own the shares before the ex-dividend date.
Please note that dividend rules and settlement timelines may vary depending on the market.