Customer segments

Dates in Shopify customer segments

Date filters accept exact dates, offsets from today, and the words today and yesterday. The old named dates like 30_days_ago are deprecated.

Build or convert a segment

Pick filters in plain English and copy a query Shopify accepts, or paste an old query to convert it.

Runs in your browser. Nothing is sent anywhere.

Open the Segment Builder

The formats Shopify accepts

  • Exact date: 2026-05-30 (YYYY-MM-DD).
  • Offset: -7d days, -2w weeks, -1m months, -1y years. Use + for the future, for example +30d with birthdays or expiring store credit.
  • Named dates: today and yesterday.
  • Exact date and time: 2026-05-30T16:00:00, in your store’s time zone, 24-hour clock with leading zeros.

You can’t add a time to an offset or a named date, and time-only values like 1pm aren’t supported.

Before, after and between

Ordered in the last 30 days
last_order_date >= -30d
Last order more than 6 months ago
last_order_date < -6m
Added in Q1 (both dates included)
customer_added_date BETWEEN 2026-01-01 AND 2026-03-31

BETWEEN can mix formats, for example BETWEEN 2026-01-01 AND today.

Dates are whole days in your time zone

last_order_date = 2026-05-30 covers midnight to midnight in your store’s time zone, not UTC.

Replace the deprecated named dates

  • 12_months_ago → -12m
  • 90_days_ago → -90d
  • 30_days_ago → -30d
  • 7_days_ago → -7d

The converter on the builder page swaps these for you.

Sources: shopify.dev: Segment query language reference; Shopify Help Center: Shopify-based customer segment filters; Shopify developer changelog: Updated function syntax on the segment query language (Oct 1, 2026). Not affiliated with, endorsed by, or sponsored by Shopify Inc. Shopify is a trademark of Shopify Inc.