Record date, ex-date, and paydate are 3 separate dates. the least important is record date. Be in before ex-date, get paid on paydate.