When a date is made up of two or more parts, use a comma to separate the parts when the parts both are words or both are numbers. A second comma follows the last item unless it is at the end of a list or sentence.
Incorrect: We will meet Friday July 15.
(Word Friday followed by another word, July--comma needed)
Correct: We will meet Friday, July 15.
Incorrect: October 31, 1517 is one of the most significant dates in history.
(The comma between the two numbers is OK, but a second comma is needed after the last item, 1517.)
Correct: October 31, 1517, is one of the most significant dates in history.
Incorrect: October, 1517, was a major month in history.
(No commas needed because word October is followed by a number, 1517.)
Correct: October 1517 was a major month in history.
If the parts of the date are connected by a preposition, no comma is needed.
Incorrect: On a Sunday, in December 1941, the U.S. found itself in World War II.
(No comma needed since the preposition in is there.)
Correct: On a Sunday in December 1941, the U.S. found itself in World War II.