What is Ex-dividend date?
The ex-dividend date is the first day a stock trades without its next dividend attached. Someone who buys on or after that date does not receive the upcoming payment; the seller does. In the US it is now usually the same day as the record date, and other markets set it by their own exchange rules.
Why Ex-dividend date matters
The share price often drops by roughly the dividend on this date, which is why buying just before it is not free money.