That is correct.. Here's a good explanation that I found.
"The ex-dividend date is the date that the company has designated as the first day of trading in which the shares trade without the right to the dividend. If you sell your shares on or after this date, you will still receive the dividend."