---
title: Relative Dates
slug: relative-dates
docTags: 
createdAt: 2025-01-08T12:16:04.506Z
---

Many functions in Carrot (CQL) that accept dates, such as the [date()](docId\:grpUvYCy4WI6Wm7kUq4bv) function, will accept **Relative Dates,**  a way of expressing date math.

### Quick Reference

| Operation            | Example                      | Description                |
| -------------------- | ---------------------------- | -------------------------- |
| `+3d`                | `date("+3d")`                | 3 days from today          |
| `-1w`                | `date("-1w")`                | 1 week ago                 |
| `+6m`                | `date("+6m")`                | 6 months from today        |
| `monthStart`         | `date("monthStart")`         | First day of current month |
| `monthStart-1d`      | `date("monthStart-1d")`      | Last day of previous month |
| `fiscalYearStart+1q` | `date("fiscalYearStart+1q")` | Start of Q2 of fiscal year |

Relative Dates are expressed as a string of operations, like `+3d` (add three days), or `fiscalYearStart+2q-1q` (starting from the beginning of the fiscal year, add two quarters and subtract one day).

Operations are always expressed as `+` or `-` followed by a number, followed by one of the following:

- `d` for days
- `w` for weeks
- `m` for months (will preserve end-of-month if the starting point is also EOM)&#x20;
- `q` for quarters (will preserve end-of-month if the starting point is also EOM)
- `y` for years

For example, `+3w` means ("plus three weeks")

Relative Dates can start with a *starting point.* If omitted, the starting point will be the current date. For example, `+3m` means ("three months from the current date") but `monthStart+3m` means ("three months from the start of the month of the current date")

Valid starting points are:

- `today` - always returns today's date
- `fiscalYearStart`
- `fiscalQuarterStart`
- `yearStart`
- `quarterStart`
- `monthStart`
- `weekStart`
- `fiscalYearEnd`
- `fiscalQuarterEnd`
- `yearEnd`
- `quarterEnd`
- `monthEnd`
- `weekEnd`

### Examples

`date("+1m")` - one month from the current date

`date("-30d", "2025-01-31")` - returns `2025-01-01`

`date("+1m-1d")` - one month, minus one day, from the current date

`date("-1y+1d")` - subtract one year, but add one day, to the current date

`date("today+1m")` - one month from today (equivalent to `date("+1m", today)`)

`date("fiscalYearStart+2q")` - two quarters from the start of the fiscal year of the current date

`date("yearStart+2q")` - two quarters from the start of the calendar year of the current date
