# How to search Gmail by date

Source: https://donezoinbox.com/how-to/search-gmail-by-date/
Updated: 2026-10-21
Note: Gmail steps checked against Google's documentation on October 20, 2026.

Click Gmail's search box and type `after:2026/04/01 before:2026/05/01` for a window of dates (year/month/day), or `older_than:1y` or `newer_than:2d` to count back from today; Google lists `d`, `m` and `y` as the units. Press Enter. Donezo Inbox's search box takes the same operators: press /, type, and mail already on your device shows as you type, with Gmail's own search following.

## How do you search Gmail by date?

1. Open Gmail on your computer and click the search box at the top.
2. For fixed dates, type `after:` or `before:` and a date, such as `after:2026/04/01` or `before:2026/05/01`. Google's own examples are `after:2004/04/16` and `before:2004/04/18`, and the same dates written month first, `after:04/16/2004` and `before:04/18/2004`.
3. To count back from today, type `older_than:` or `newer_than:` and a number with a unit: `d` (day), `m` (month) or `y` (year), such as `older_than:1y` or `newer_than:2d`.
4. Put two operators in one search to make a window, and add more to narrow it, for example `after:2026/04/01 before:2026/05/01 from:amy@example.com has:attachment`. Press Enter.
5. Prefer a form? Click **Show search options** in the search box, fill in any of From, To, Subject, Has the words, Doesn't have, Size and **Date within**, then click **Search** at the bottom.

- **People:** `from:me`, `from:amy@example.com`, `to:john@example.com`. `cc:` and `bcc:` work the same way.
- **Attachments and size:** `has:attachment` finds mail with attachments. `larger:10M` and `smaller:` find mail by size, and `size:1000000` takes a number of bytes.
- **Status, labels and places:** `is:unread` (also `is:read`, `is:starred`, `is:important`), `label:friends`, `category:promotions` (also primary, social, updates, forums), `in:anywhere movie` (includes Spam and Trash), `in:archive` and `in:snoozed`.
- **Combining:** `from:amy OR from:david` (or `{from:amy from:david}`) matches either, `from:amy AND to:david` needs both, `dinner -movie` leaves out a word, `"dinner and movie tonight"` matches an exact phrase, and `subject:(dinner movie)` groups terms.
- **Newest first:** above the results, click **Most relevant** and choose **Most recent** to list them in date order.
- **What Google does not say:** its page does not say whether `after:` and `before:` include the date you type, whether dates follow a time zone, or whether the Show search options form and the search box return identical results. `older_than:` and `newer_than:` are documented in days, months and years only, not hours.
- Spam and Trash are left out of a standard search. Add `in:anywhere` to include them. When you use a negative operator, one that starts with a minus sign, Google warns that a conversation can still appear if at least one of its messages matches.

> These steps follow [Google's own documentation](https://support.google.com/mail/answer/7190?hl=en&co=GENIE.Platform%3DDesktop), read on October 20, 2026 for Gmail on the web (desktop). They were checked against the documentation, not clicked through in a real account. The Show search options form, the Most recent switch and the Spam and Trash tip come from Google's page on searching in Gmail (support.google.com/mail/answer/6593), read the same day. Neither page says whether the form and the search box give the same results. Menus change now and then; if a label differs, Google's page is the reference.

## How do you search by date in Donezo Inbox?

Donezo Inbox passes what you type to Gmail's own search, so the operators above work as written. It also keeps a search index of mail it has already loaded on your device, so the first results appear while you are still typing.

1. Press /, or click **Search** in the sidebar. The box shows an example: `from:sam has:attachment newer_than:7d`.
2. Type your operators, for example `after:2026/04/01 before:2026/05/01 from:priya`. Write dates year first (`2026/04/01`): the on-device pass does not read the month-first form `04/01/2026`.
3. Results from your device appear as you type. Press **Enter** to ask Gmail at once; otherwise Gmail's search runs about 0.4 seconds after you stop typing. What Gmail finds is added after the rows already shown, and nothing above them moves when Gmail answers.
4. With two or more inboxes and All inboxes on, the chip at the right of the box reads **All accounts** or **This inbox**; click it to switch. A search opened from All inboxes starts on All accounts, and one opened elsewhere starts on This inbox.
5. Press Esc to close search.
6. For a question that is not an operator, such as "what did Priya say about pricing?", press ⌘J (Ctrl + J on Windows) outside a draft to open **Ask your inbox**. It plans Gmail searches, runs them on every linked inbox and on the device, reads the best matches (up to eight sources) and answers with numbered citations. **Looked for** lists the searches it ran, and **Open as search** runs the main one as a search in the list.

**Operators that matter most: Google's wording, and what Donezo Inbox's on-device pass does with them**

| Operator | What Google says it does | On your device first |
| --- | --- | --- |
| `after:` `before:` | Search for emails received during a certain time period. | Read, in the year-first slash form only |
| `older_than:` `newer_than:` | Search for emails older or newer than a time period (d, m, y). | Read; a month counts as 30 days and a year as 365 |
| `from:` `to:` | Find emails sent from, or to, a specific person. | Read; `to:`, `cc:` and `bcc:` need the conversation's messages to be loaded on the device |
| `has:attachment` | Find emails that include attachments. | Read |
| `larger:` `smaller:` `size:` | Find emails by their size. | Not read; Gmail answers |
| `is:unread` | Search for emails by their status. | Read for unread, read and starred; important is approximated |
| `label:` `category:` | Find emails under one of your labels, or one of the inbox categories. | Read, except `category:primary`, which Gmail answers |
| `in:` | `in:anywhere` finds emails across Gmail, Spam and Trash included. | Read for anywhere, inbox, sent, drafts, trash, spam and archive; `in:snoozed` is not read |
| `OR` `"quotes"` `-minus` | Match one or more criteria, an exact phrase, or leave a term out. | Read; the braces form `{ }` is not |
| `( )` | Group multiple search terms together. | Not grouped; Gmail does the grouping |

![Donezo Inbox's search box with the query has:attachment newer_than:30d typed in, the This inbox chip at the right, and ten matching conversations listed below](https://donezoinbox.com/img/howto-search-this-inbox.webp)
*A date search in one inbox. Screenshot of the demo mailbox, with sample mail.*

![Donezo Inbox's search box with the query from:stripe newer_than:30d, the All accounts chip at the right, and seven results from Stripe taken from several inboxes](https://donezoinbox.com/img/howto-search-all-accounts.webp)
*The same kind of search across every inbox, with the All accounts chip. Screenshot of the demo mailbox.*

- **What the device holds:** summaries of recent mail (Donezo Inbox's background fill covers about the last 60 days, over a few sessions) and the text of conversations it has loaded. Older mail comes from Gmail's answer a moment later. If Gmail cannot be reached, what the device found is the result.
- **Operators the device cannot read:** if you search with only operators it does not read, such as `larger:10M`, it can list ordinary mail first because it cannot judge the size. Gmail's matches are added after them. Add an operator it does read, such as `has:attachment` or a date, to keep the list short.
- **Archived mail:** search covers it. The **Done** view (G then E) lists mail that has left the inbox and **All mail** (G then A) lists everything except Spam and Trash. For steps to find and restore archived mail, see [how to find archived emails in Gmail](https://donezoinbox.com/how-to/find-archived-emails-in-gmail/). To delete what a date search finds, see [how to delete old emails](https://donezoinbox.com/how-to/delete-old-emails-in-gmail/).
- **Ask needs an AI provider:** hosted AI has a small free allowance; after that, add your own key under Settings, then AI, or upgrade.

The demo searches sample mail with its own stand-in for Gmail's search, and its Ask answers come from a stand-in for the AI model, so unusual operators may behave differently from a real account. [Open the live demo](https://donezoinbox.com/demo): it runs with sample mail, no sign-in.

## Can Claude or Codex search your Gmail by date?

Yes, and it only reads. The connector's `list_threads` tool takes Gmail search syntax, so the operators above work in a prompt. It searches one inbox or all of them and returns 20 conversations per inbox by default, or up to 50 if you ask for 50, newest first.

**Read only: a dated search across all inboxes**

```text
Using Donezo, search all my inboxes for mail from Priya with an attachment from the last 30 days (search: from:priya has:attachment newer_than:30d). Do not change anything. Show subject, date and account for each, newest first.
```

**Read only: a window of dates**

```text
Now search for mail from Priya between 1 April 2026 and 1 May 2026 (search: after:2026/04/01 before:2026/05/01 from:priya). Only read. Ask for 50 results per inbox. Tell me how many came back per account and the three most recent subjects. If an inbox returned 50, say so, because that is the most one search returns.
```

> Neither prompt needs approval, because neither sends, schedules, forwards or deletes, and a connection set to Read only can run both. Reading, searching and drafting work on every plan.

Tools involved: `list_threads`. The full list, permissions and setup commands are in the [connector documentation](https://donezoinbox.com/integrations/claude-and-codex/docs/).

## What if the search finds nothing, or too much?

- **Nothing comes back.** Remove filters one at a time; a misspelled address in `from:` or a wrong year in a date is the usual cause. Spam and Trash are left out of a standard search, so add `in:anywhere` if the mail may be there.
- **An old email will not appear.** Check that the date operators use a form Google lists: `2026/04/01` or `04/01/2026`. Archived mail is in All Mail, and `in:archive` shows only that part.
- **Excluded mail still shows up.** Google says Gmail finds matching messages first, so a conversation with one matching message can appear even when others in it contain a word you excluded.
- **Donezo Inbox lists mail that does not match.** The device answers first and cannot read every operator, such as `larger:`; Gmail's matches follow. Add an operator it reads, or a date, to narrow the first rows.
- **A date search in Donezo Inbox shows everything.** Write the date year first, `after:2026/04/01`. The month-first form is read by Gmail but not by the on-device pass.
- **Only one inbox was searched.** Click the chip at the right of the search box so it reads All accounts. It appears when you have two or more inboxes and All inboxes is on.

## Questions

### How can I filter out unread emails in Gmail?

Search `is:unread`. `is:read` finds the opposite, and you can add a date, such as `is:unread newer_than:7d`. Donezo Inbox takes the same search in its search box.

### What is the syntax for filtering emails in Gmail?

An operator, a colon and a value, with no space: `from:amy@example.com`. Put operators side by side to require all of them, join alternatives with `OR`, leave a term out with a minus sign, quote an exact phrase and group terms in parentheses.

### Why can't I search old emails in Gmail?

Most often the mail is in Spam or Trash, which a standard search leaves out; add `in:anywhere`. Next check the date and the address you typed. Archived mail is searchable and sits under All Mail.

### How do I find the oldest email in Gmail?

The pages Google publishes on search describe a switch between Most relevant and Most recent, not an oldest-first order. Use `before:` with a date far back, such as `before:2012/01/01`, and move the date later until mail appears. These steps are for Gmail on the web; Google's mobile apps are not covered here.

### Can I search several Gmail accounts at once?

In Donezo Inbox, yes: with two or more inboxes and All inboxes on, the chip at the right of the search box switches between This inbox and All accounts.

### Does Donezo Inbox search as you type?

In part. Results from mail already on your device appear as you type. Gmail's own search runs about 0.4 seconds after you stop, or when you press Enter, and adds what the device did not have, which includes older mail.

## Related

- [How to clean up your Gmail inbox](https://donezoinbox.com/how-to/clean-up-your-gmail-inbox/)
- [How to find archived emails in Gmail](https://donezoinbox.com/how-to/find-archived-emails-in-gmail/)
- [How to delete old emails in Gmail](https://donezoinbox.com/how-to/delete-old-emails-in-gmail/)
- [Gmail keyboard shortcuts: how to turn them on and which to learn](https://donezoinbox.com/how-to/gmail-keyboard-shortcuts/)
- [An AI email assistant that never sends without you](https://donezoinbox.com/ai-email-assistant/)

## Try a dated search on sample mail

The demo needs no sign-in: press / and try `from:` with `newer_than:7d`. When a search shows how much has piled up, the ordered plan is in [how to clean up your Gmail inbox](https://donezoinbox.com/how-to/clean-up-your-gmail-inbox/).

Live demo (sample mail, no sign-in): https://donezoinbox.com/demo
