Question about dividend timing

How does a company determine who gets a dividend on their stocks?

An example:

Corporation ABC is going to pay a dividend 09/01/10

Will the person who buys stock in ABC on 08/31/10 receive the dividend?

I assume that dividends are calculated and set aside some time in advance.

Here’s a good summary: