To summarize: A company’s board declares a dividend, to be paid on a certain date to shareholders of record as of a prior date. In order to be one of those shareholders of record, you need to buy or already own shares before the ex-div date, which is the business day before the record date.