Date comma rules
US date comma rules with examples, plus how to handle commas when extracting dates from text so the date is captured cleanly and the surrounding sentence stays unchanged.
Commas in written US dates follow a few consistent conventions. Those conventions also decide where a date begins and ends in running text. This guide covers the rules first. It then shows how to account for commas when extracting dates, so the date is captured cleanly and the surrounding sentence is left untouched.
What the comma does in a written date
In US month-day-year style, a comma separates the day number from the year so the two numbers don't run together. Compare "July 4 1776" with "July 4, 1776". When a full date appears in the middle of a sentence, a second comma follows the year and closes it off, much like a parenthetical. Major US style guides, including AP and Chicago, follow this pattern. They differ on other details, such as when to abbreviate month names.
The core rules, with examples
- Month, day and year in mid-sentence: put a comma after the day and after the year. Example: The contract signed on March 3, 2026, takes effect immediately.
- Full date at the end of a sentence: put a comma after the day only, and let the period close the sentence. Example: The contract was signed on March 3, 2026.
- Month and year only: no comma. Example: The office opened in March 2026.
- Month and day only: no comma. Example: Payments are due March 3.
- Day-month-year order: no comma. Example: The office opened on 3 March 2026.
- Weekday included: put a comma after the weekday, after the day and after the year. Example: On Tuesday, March 3, 2026, the office opened.
- Numeric formats such as 03/03/2026 or 2026-03-03: no commas inside the date.
Writers most often leave out the comma after the year. For extraction, that comma matters least, because it belongs to the sentence rather than to the date.
What date extraction does with these commas
A date extraction tool or pattern scans plain text, finds the spans that represent calendar dates and returns them. The output often includes each date's position in the text. Some tools also return a normalized form, such as the ISO 8601 format 2026-03-03. Commas affect the result in two ways. The comma between the day and the year is part of the date span. A comma after the year is sentence punctuation, so it should stay out of the match and stay in the text.
| Input | Expected match | Why |
| The deal closed on March 3, 2026, after review. | March 3, 2026 | The trailing comma belongs to the sentence. |
| Signed March 3 2026 by both parties. | March 3 2026 | The writer omitted the day-year comma, but it is still a date. |
| On Tuesday, March 3, 2026, the office opened. | March 3, 2026, or Tuesday, March 3, 2026 if weekdays are captured | The weekday comma is part of the date only if your output includes weekdays. |
| The office opened in March 2026. | March 2026, if month-year dates are in scope | This format has no comma. |
| The May 12,000-unit order shipped. | No match | The comma here is a thousands separator, not a date comma. |
Step by step: handling commas when recognizing dates
- 1. Collect real samples from your text. Include dates with and without the day-year comma, dates followed by a comma, and numbers that only look like dates.
- 2. Make the comma between the day and the year optional, because writers often leave it out (March 3 2026).
- 3. Require whitespace after that comma. This stops a number with a thousands separator, such as May 12,000, from being read as a date.
- 4. End the match at the last digit of the year, so any trailing comma stays outside the span.
- 5. Decide how to treat spacing characters. A non-breaking space (U+00A0, a space that prevents a line break) may sit between the month and the day in typeset or web-copied text. Whether a whitespace token matches it depends on your regex engine and its Unicode mode.
- 6. Extract without editing. Record the matched span and its offsets, and write any normalized form to a separate field instead of replacing text in the source.
- 7. Run the pattern on your sample set and compare its matches with the dates a person would mark by hand.
Example pattern
The following regular expression is an illustration for full month names in month-day-year order. It has not been tested here against a specific engine, so check it against your own samples.
\b(?:January|February|March|April|May|June|July|August|September|October|November|December)\s+\d{1,2},?\s+\d{4}\b
Here is what each part does. The ",?" makes the day-year comma optional. The "\s+" that follows requires at least one whitespace character before the year. The final "\b" (a word boundary) stops the year from continuing into more digits. The pattern never consumes the comma after the year, so that comma stays with the sentence.
Illustrative Python usage follows. This is an untested example, not verified output. By the pattern's logic, it should report a single match, March 3, 2026, with the trailing comma excluded. It should not match May 12,000.
import re
MONTHS = "January|February|March|April|May|June|July|August|September|October|November|December"
DATE = re.compile(r"\b(?:" + MONTHS + r")\s+\d{1,2},?\s+\d{4}\b")
text = "Signed on March 3, 2026, the contract replaced the May 12,000-unit order."
for m in DATE.finditer(text):
print(m.start(), m.end(), repr(m.group()))
Edge cases to check
- Consecutive dates: in "March 3, 2026, and April 1, 2026," each date should be a separate match, and both trailing commas should stay in the text.
- Shared years: "March 3, 4 and 5, 2026" names three dates but writes the year once. The example pattern will not match it at all, so expressions like this need separate handling.
- Abbreviated months: AP style writes Mar. 3, 2026. Add abbreviations, with an optional period, if your text uses them.
- Ordinals: March 3rd, 2026 appears in informal text even though formal style guides avoid it. Allow optional st, nd, rd and th suffixes only if your samples contain them.
- Letter case: the example pattern is case-sensitive, so it will not match "march 3, 2026". A case-insensitive flag fixes that but makes it easier for the verb "may" to produce false matches.
- Non-ASCII commas: in mixed-language text, a fullwidth comma (U+FF0C) or an Arabic comma (U+060C) will not match an ASCII comma. Include these characters explicitly if they appear in your input.
Verifying the result
Confirm three things. First, if the job is extraction only, the source text should be identical before and after the run, including the number of commas. Second, every match should end on a year digit, not on a comma or a space. Third, every date in your hand-marked samples should appear in the output, and nothing else should. Inspect any mismatch to see whether a comma rule, a spacing character or an unhandled format caused it.
Gaps in this guide
No evidence about a particular extraction tool was supplied. As a result, this guide does not describe any product's settings, defaults or accuracy. Style details beyond the core comma rules, such as abbreviations and ordinals, vary between guides, so check them against the style your organization follows. Non-US date conventions are covered only where they affect comma handling.