Does Grok X Search include the end date of a date filter?

The Citead team, updated

In short. Grok X Search treats to_date as an exclusive end boundary and expects YYYY-MM-DD values.

Definition: No. In xAI's X Search tool, to_date is an exclusive upper boundary. The documented range starts at 00:00 UTC on from_date and ends immediately before to_date.

Key facts

  • xAI's X Search documentation defines from_date and to_date as the start and end of a date range, using YYYY-MM-DD values.
  • The range includes posts from 00:00 UTC on from_date and excludes to_date.
  • To search one calendar day, xAI says to set to_date to the following day.
  • The documented filter applies to date-only values in YYYY-MM-DD format.
  • The date parameters apply to keyword and semantic searches. Thread fetches do not use them.
  • X's Search Posts Recent reference uses separate start_time and end_time parameters, so its field names should not be substituted for xAI's X Search fields.

How does the to_date boundary work?

xAI describes the interval in UTC. from_date marks 00:00 UTC on the starting date, and to_date marks the point at which the interval stops. Because the endpoint is excluded, a value of 2026-10-01 does not include posts from that date. It includes the preceding period that begins with 2026-09-28 in the documentation's example.

The documented request shape is:

{
  "type": "x_search",
  "from_date": "2026-09-28",
  "to_date": "2026-10-01"
}

The date range section of xAI's X Search guide says the filter limits data to posts from 00:00 UTC on from_date up to, but not including, to_date. This makes the example a range ending at the start of 1 October in UTC.

How should a one-day search be configured?

For a single calendar day, the end value is the next calendar day. A range that starts on a given date therefore needs a to_date one day later, because the end boundary is excluded. The documentation gives YYYY-MM-DD as the format and says that a full date-time is not applied.

The date-only rule matters when a request is assembled in code. A timestamp such as 2026-09-28T00:00:00Z is a different format from the documented value 2026-09-28, and xAI says dates in other formats are not applied. The filter is therefore expressed with calendar dates and its UTC interpretation comes from the tool documentation.

Which X Search operations receive the filter?

xAI documents X Search as supporting keyword search, semantic search, user search, and thread fetch. Its filter explanation narrows the date parameters to keyword and semantic searches, regardless of the query written by the model. Thread fetches fall outside the handle and date parameters. A date range therefore describes the post search operations covered by the documentation, while a thread fetch has a separate scope.

How is this different from the X API date interface?

X's Search Posts Recent reference describes a separate endpoint. It says that at most one of start_time and since_id may be provided, and at most one of end_time and until_id may be provided. The same reference states that start_time must be within the last 7 days. Those are X API request rules; xAI's X Search tool exposes from_date and to_date instead.

The distinction prevents a date filter from being translated by field name alone. For xAI's tool, the source that defines the boundary is the X Search documentation: to_date is exclusive, the range begins at 00:00 UTC on from_date, and a one-day range ends on the following date.

FAQ

Does to_date include posts from that date?

No. The documented upper boundary is exclusive. To include a full calendar day, set to_date to the day after it.

Can you pass a full timestamp to to_date?

No. xAI documents YYYY-MM-DD and says that other formats, including full date-times, are not applied.

Does the date filter apply to a thread fetch?

No. The xAI guide applies the handle and date parameters to keyword and semantic searches and says that thread fetches do not use them.

Sources

  1. xAI, "X Search", 10 October 2026
  2. X Developer Platform, "Search Posts Recent", 7 August 2026

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark