# since: and until: Explained: X Date and Time Operators

since: returns posts on or after a date, and until: returns posts before a date, so since:2026-01-01 until:2026-02-01 covers exactly January 2026.

[![apidojo](/blog/authors/apidojo.png)**Apidojo** *15+ years of experience in data retrieval.*](/blog/authors/apidojo/)

**30 September 2026** Published

**4 min** Read

![Cover card reading 'since: and until: Explained: X Date and Time Operators'](/blog/covers/since-until-operators.png)

**`since:` returns posts on or after a date, and `until:` returns posts before a date, so `since:2026-01-01 until:2026-02-01` covers exactly January 2026.** Both accept a time and time zone, `since:2026-01-15_14:30:00_UTC`, for windows shorter than a day.

X search has 9 date and time operators. This reference explains each one, how the boundaries behave, and how to turn a post ID into a timestamp. The everyday guide is [how to search tweets by date](/blog/twitter-search/search-tweets-by-date/); the full list of operators is in the [Twitter advanced search operators](/blog/twitter-search/advanced-search-operators/) reference.

## X Date and Time Operators

**X date and time operators filter posts by calendar date, clock time, Unix time, post ID or a rolling window.** Listed below are the 9 operators ([twitter-advanced-search reference](https://github.com/igorbrigadir/twitter-advanced-search)).

| Operator | Boundary | Example |
| --- | --- | --- |
| since:YYYY-MM-DD | On or after the date (inclusive) | since:2026-01-01 |
| until:YYYY-MM-DD | Before the date (exclusive) | until:2026-02-01 |
| since:YYYY-MM-DD_HH:MM:SS_TZ | On or after a date and time | since:2026-01-15_14:30:00_UTC |
| until:YYYY-MM-DD_HH:MM:SS_TZ | Before a date and time | until:2026-01-15_18:00:00_UTC |
| since_time:UNIX | On or after a Unix timestamp in seconds | since_time:1561720321 |
| until_time:UNIX | Before a Unix timestamp in seconds | until_time:1562198400 |
| since_id:ID | After a post ID (exclusive) | since_id:1138872932887924737 |
| max_id:ID | At or before a post ID (inclusive) | max_id:1144730280353247233 |
| within_time:N | Within the last N days, hours, minutes or seconds | within_time:3h |

All time operators need at least one other term in the query, such as a keyword or `from:`.

## Is since: Inclusive and until: Exclusive?

**Yes, `since:` includes posts from its own date and `until:` excludes posts from its own date.** To search one day, set `until:` to the next day: `since:2024-11-05 until:2024-11-06` returns 5 November 2024 only. To search to the end of a month, set `until:` to the first day of the next month.

## How Do You Search by Time of Day on X?

**To search by time of day, add the time after the date with an underscore, then the time zone: `since:2024-11-05_18:00:00_UTC`.** Use 24-hour time and a time zone abbreviation. A two-hour window during a live event:

```
#WorldSeries since:2024-10-30_23:00:00_UTC until:2024-10-31_01:00:00_UTC
```

X stores post times in UTC, so a UTC window avoids confusion between your local time and the author’s ([twitter-advanced-search reference](https://github.com/igorbrigadir/twitter-advanced-search)).

## How Do You Use Unix Timestamps in X Search?

**To use a Unix timestamp, write the number of seconds since 1 January 1970 UTC after `since_time:` or `until_time:`.** `since_time:1561720321 until_time:1562198400` covers 28 June 2019 up to the start of 4 July 2019 (UTC). Unix time is easier than date strings when your data already stores timestamps.

## How Do You Turn a Tweet ID Into a Date?

**A tweet ID contains its own creation time: shift the ID right by 22 bits and add 1288834974657 to get the time in milliseconds since 1970.** This works for posts created since X introduced these “Snowflake” IDs in June 2010 ([twitter-advanced-search reference](https://github.com/igorbrigadir/twitter-advanced-search)).

```
from datetime import datetime, timezone

def tweet_id_to_datetime(tweet_id: int) -> datetime:
    ms = (tweet_id >> 22) + 1288834974657
    return datetime.fromtimestamp(ms / 1000, tz=timezone.utc)

def datetime_to_tweet_id(dt: datetime) -> int:
    ms = int(dt.timestamp() * 1000)
    return (ms - 1288834974657) << 22

print(tweet_id_to_datetime(1728108619189874825))
```

The reverse function builds a boundary ID for `since_id:` or `max_id:`. Avoid doing this in JavaScript with ordinary numbers, which can’t hold 64-bit IDs exactly; use `BigInt`. Looking up a post from its ID is covered in how to view a tweet by ID on X.

## How Do You Search the Last Few Hours on X?

**To search the last few hours, add `within_time:` with a number and a unit: `d` for days, `h` for hours, `m` for minutes, `s` for seconds.** `"outage" within_time:2h` returns posts about an outage from the last 2 hours. For the opposite problem, a post from years back, see [how to find old tweets on X](/blog/twitter-search/find-old-tweets/).

## Do since: and until: Work in the X API?

**No, the X API sets dates with the `start_time` and `end_time` request parameters instead of `since:` and `until:`.** Full-archive search returns the last 30 days unless you set them ([X API quickstart](https://docs.x.com/x-api/posts/search/quickstart/full-archive-search.md)). The API options are compared in the [Twitter search API guide](/blog/twitter-api/search-api/).

## How Do You Use since: and until: in apidojo’s Actors?

**apidojo’s Twitter actors accept `since:` and `until:` inside the `searchTerms` query, exactly as typed on X, and their documentation recommends queries over the separate `start` and `end` inputs for date filtering.** The `start` and `end` inputs apply only to `searchTerms`, not to `startUrls` or `twitterHandles` ([Apify](https://apify.com/apidojo/tweet-scraper)).

```
{
  "searchTerms": ["#WorldSeries since:2024-10-30_23:00:00_UTC until:2024-10-31_01:00:00_UTC"],
  "sort": "Latest + Top"
}
```

The actor’s documentation notes lower result counts on queries that use `until:`, and suggests `sort: Top` or `Latest + Top` when that happens. The developer workflow is [how to scrape tweets by date range](/blog/twitter-scraping/scrape-tweets-by-date/).

## The scrapers behind this

-   [Tweet Scraper V2 Tweets from searches, profiles, Lists and URLs; 49–64 tweets/sec; minimum 50 per query $0.40 / 1K tweets](/scrapers/twitter-scraper/)

## Questions people ask

### Does since: use my time zone?

A date without a time is interpreted by X; add a time and `_UTC` when the exact boundary matters.

### Can you use since: without until:?

Yes, `since:2026-01-01` alone returns everything from that date to now.

### Why does until: miss posts from the end date?

Because `until:` is exclusive; set it to the day after the last day you want.

### What date format does since: need?

`YYYY-MM-DD`, with a four-digit year and two-digit month and day.

![apidojo](/blog/authors/apidojo.png)

## [Apidojo](/blog/authors/apidojo/)

15+ years of experience in data retrieval.

API Dojo is always ready for you. With 15+ years of experience, data acquisition has never been that easy. Cheapest prices with high availability.

-   🏯 15+ years of experience in data retrieval.
-   💰 Cheapest prices, qualified data.
-   ⚙️ High availability, extreme maintenance.
-   🐉 Hyper communicative, excellent support.

-   [apidojo.io](https://apidojo.io)

## More in this cluster

-   [X (Twitter) search operators and how to use them Every X search operator that works, with the date, account, keyword and reply guides that show what each one does in practice.](/blog/twitter-search/)
-   [from: vs to: vs @username on X Search On X search, from:username finds posts an account wrote, to:username finds replies sent to that account, and @username finds any post that mentions it.](/blog/twitter-search/from-to-mention-operators/)
-   [How to Find Old Tweets on X To find old tweets on X, search a keyword with a date window, for example "world cup" since:2014-06-12 until:2014-07-14, then open the Latest tab.](/blog/twitter-search/find-old-tweets/)
-   [How to Find Viral Tweets About Any Topic To find viral tweets about a topic, search the topic with a high like threshold and no reposts, for example "remote work" min\_faves:5000 -filter:retweets.](/blog/twitter-search/find-viral-tweets/)
-   [How to Search Tweets by Date on X (Twitter) To search tweets by date on X, type your keyword followed by since:YYYY-MM-DD and until:YYYY-MM-DD into the search bar, then open the Latest tab.](/blog/twitter-search/search-tweets-by-date/)
-   [How to Search Tweets by Likes, Reposts and Replies To search tweets by likes on X, add min\_faves: and a number to your query, for example bitcoin min\_faves:1000 for posts with at least 1,000 likes.](/blog/twitter-search/search-by-engagement/)
-   [How to Search Tweets From a Specific User To search tweets from a specific user on X, type from:username into the search bar, followed by any keyword you remember.](/blog/twitter-search/search-tweets-from-user/)
-   [Twitter (X) Advanced Search Operators Twitter (X) advanced search operators are commands you type into the X search bar to filter posts by account, date, words, engagement and media.](/blog/twitter-search/advanced-search-operators/)
-   [Why X Search Can't Find an Old Tweet (and What to Try) X search can't find an old tweet when the post was deleted, sits on a protected, suspended or deactivated account, or when your query's words or dates don't.](/blog/twitter-search/old-tweet-not-showing/)
