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.
The formats Shopify accepts
- Exact date:
2026-05-30(YYYY-MM-DD). - Offset:
-7ddays,-2wweeks,-1mmonths,-1yyears. Use+for the future, for example+30dwith birthdays or expiring store credit. - Named dates:
todayandyesterday. - 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
last_order_date >= -30dlast_order_date < -6mcustomer_added_date BETWEEN 2026-01-01 AND 2026-03-31BETWEEN 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→-12m90_days_ago→-90d30_days_ago→-30d7_days_ago→-7d
The converter on the builder page swaps these for you.
Related guides
- Shopify segments: = true is now MATCHES
- Shopify customer segment query examples
- Why your Shopify segment query isn’t working
- All Segment Builder guides
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.