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.

Cover card reading '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. 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; the full list of operators is in the Twitter 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).

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).

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).

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.

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). The API options are compared in the Twitter search API guide.

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).

{
  "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.

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.