yes, you have to own on the ex-date and the record date. After that, you've met your obligation and the divy is yours. The pay date is the day the divy is paid.