How to Recognize Dates and Date Ranges in AP Style Text
A practical guide to finding AP Style dates and date ranges in text: month abbreviations, hyphenated ranges, time-date-place order and a sample extraction pattern.
Date extraction scans text for calendar expressions such as Oct. 4 or Oct. 30-Nov. 2 and returns them as structured data. Copy written in AP Style, the convention used by many U.S. newsrooms and press offices, is a good fit for this because it writes dates in predictable ways. This guide explains what to look for, how ranges appear, and how to pull them out without changing the original wording.
What date extraction does for your text
The input is plain text, such as articles, press releases or event listings. The output is a list of matches. Each match holds the original string exactly as written, its start and end position in the text, and optionally a normalized value such as 2026-10-04 in ISO 8601 (the year-month-day standard format). Extraction is read-only. The source text changes only if you deliberately add a replacement step. The scope here is explicit calendar dates and date ranges. Relative references such as Friday or next week can only be resolved against a known reference date, usually the publication date, so treat them as a separate task.
Evidence gap: no source material was supplied for this guide. The conventions below are widely cited AP Style rules, not quotations from a specific edition. AP revises its stylebook periodically, so check the current edition and any house rules before building patterns around them.
AP Style date format at a glance
| Element | Common AP convention | Example |
| Month with a specific date | Abbreviate Jan., Feb., Aug., Sept., Oct., Nov., Dec.; spell out March, April, May, June, July | Oct. 4; June 12 |
| Month alone or with a year only | Spell out the month; no comma before the year | October 2026 |
| Full date with year | Comma after the day, and after the year when the sentence continues | Oct. 4, 2026, was the deadline. |
| Day number | Cardinal figure, no ordinal suffix | Oct. 4 (not Oct. 4th) |
| Day of the week | Spelled out, often used for events within the coming week | Friday |
| Time of day | Figures with a.m. or p.m.; no :00 on the hour; noon and midnight as words | 7 p.m.; 10:30 a.m. |
These details matter for matching. Generic date patterns often expect Sep or full month names. AP copy uses Sept. with a period, and it spells out short months like March even when a day follows. Quoted material, reader submissions and copy from other style guides may not follow these rules, so a strict AP pattern will miss some dates in mixed text.
How AP Style writes date ranges
AP Style does not use the en dash. Compliant copy marks compact ranges with a plain hyphen, usually without spaces. In running prose, ranges are often written with words instead, such as from ... to or through. The forms below are illustrative examples of what to expect:
- Same month, hyphen: Oct. 4-6
- Across months, hyphen: Oct. 30-Nov. 2
- Running text: from Sept. 28 to Oct. 3
- Across years: Dec. 29, 2026, to Jan. 2, 2027
- Days of the week: Monday through Friday
- Months only: from March to May
Watch for characters that look identical but are not. AP copy should contain the hyphen-minus (U+002D). Text pasted from word processors or edited elsewhere may instead contain an en dash (U+2013), an em dash (U+2014) or a minus sign (U+2212). A no-break space (U+00A0) may also sit between the month and the day. Decide which variants your pattern accepts. Do not silently rewrite them in the source, because that changes the published text.
Time, date, place order
For event details, AP's commonly cited order is time, then date, then place, as in this example: 7 p.m. Friday at City Hall, or 9 a.m. Oct. 4 in the main auditorium. For extraction, this means a date is often preceded by a time and followed by a location. Capture the time as its own field rather than merging it into the date. Keep the place out of the match. A bare weekday like Friday can only become a calendar date after you anchor it to the article's publication date.
Step-by-step: extracting dates and ranges
- 1. Gather a representative sample of your texts and mark the dates and ranges by hand. This is your reference set.
- 2. Leave the source unchanged. Allow variant dashes and spaces in the pattern itself, or match against a normalized copy while keeping a map back to the original positions.
- 3. Match ranges before single dates (longest match first). This keeps Oct. 4-6 from splitting into Oct. 4 and a stray 6.
- 4. Filter false positives. May and March are also ordinary words. Requiring a day number after the month removes most cases, such as in May.
- 5. Handle missing years. AP often omits the year for dates in the current year. If you infer a year from context, label it as inferred.
- 6. Normalize each match to a start and end value, for example 2026-10-30 to 2026-11-02, and keep the original string next to it.
- 7. Verify the run. Compare match counts with your reference set, spot-check every range, and confirm the source text is byte-for-byte unchanged, for example by comparing a checksum before and after.
Example pattern (illustrative)
The Python sketch below shows one way to match AP-style single dates and ranges. It is an example only. It has not been tested against a real corpus, so check it against your reference set before relying on it.
import re
MONTH = r"(?:Jan\.|Feb\.|March|April|May|June|July|Aug\.|Sept\.|Oct\.|Nov\.|Dec\.)"
DAY = r"(?:3[01]|[12][0-9]|[1-9])(?!\d)"
SPACE = r"[ \u00A0]" # regular or no-break space
DASH = r"[-\u2013]" # hyphen-minus or en dash
YEAR = r"(?:,[ \u00A0]\d{4})?" # optional trailing year
MID_YEAR = r"(?:,[ \u00A0]\d{4},?)?" # optional year before "to"
DATE_RANGE = re.compile(
rf"\b{MONTH}{SPACE}{DAY}"
rf"(?:{DASH}(?:{MONTH}{SPACE})?{DAY}"
rf"|{MID_YEAR}{SPACE}(?:to|through){SPACE}(?:{MONTH}{SPACE})?{DAY})?"
rf"{YEAR}"
)
text = ("The festival runs Oct. 30-Nov. 2 at the fairgrounds. "
"Registration is open from Sept. 28 to Oct. 3, 2026. "
"Organizers may add dates in May.")
for m in DATE_RANGE.finditer(text):
print(m.start(), m.end(), repr(m.group()))
Intended result for the sample text (expected, not verified output): two matches, Oct. 30-Nov. 2 and Sept. 28 to Oct. 3, 2026. The final May should not match, because no day number follows it. The word from stays outside the match, and the positions point into the original, unmodified string.
Known gaps in this pattern: it does not capture weekday ranges (Monday through Friday), month-only ranges (from March to May), times, ordinals such as Oct. 4th, or non-AP spellings such as Sep. 4 or September 4. It also does not accept em dashes or minus signs. Add these only if your texts contain them, and re-run your reference set after each change so that a broader pattern does not introduce new false matches.