Which sentence uses commas correctly?

A.
On May 31, 1890 the railroad built its first tracks through the prairie town.

B.
On May, 31 1890 the railroad built its first tracks through the prairie town.

C.
On May 31 1890, the railroad built its first tracks through the prairie town.

D.
On May 31, 1890, the railroad built its first tracks through the prairie town.