Docs
Explorar la documentación

Date ranges and comparisons

Pick date range presets or custom dates, compare with the previous period or the same period last year, and choose chart intervals, all in the site's timezone.

Ver como Markdown

Presets#

Preset API value
Today today
Yesterday yesterday
Last 24 hours 24h
Last 7 / 14 / 28 / 30 / 90 days (including today) 7d, 14d, 28d, 30d, 90d
Month to date mtd
Last month last_month
Quarter to date qtd
Last quarter last_quarter
Year to date ytd
Last 12 months 12mo
Last calendar year last_year
All time (from the first event) all
Custom custom with from and to (inclusive, YYYY-MM-DD)

The default is Last 30 days. ◀ and ▶ (or [ and ]) step back and forward by one period.

Timezone#

Ranges are calendar days in the site's timezone (Site settings → General). Data is stored in UTC, so changing the timezone re-buckets history instantly. "Last 24 hours" is a rolling window. See Timezones.

Comparisons#

Option API value
Off none
Previous period (the same length, immediately before) previous_period
Same period last year previous_year
Custom custom with compare_from and compare_to

Match day of week (match_weekday=true) shifts the comparison by whole weeks (previous period) or 52 weeks (previous year), so Mondays are compared with Mondays.

Intervals#

auto picks hours for one day or less, days up to 92 days, weeks up to a year and months beyond. You can choose minute (ranges of one day or less), hour (up to 14 days), day, week, month, quarter or year.