# now() in CQL: relative dates in Confluence search

URL: https://goingstellar.ro/reference/cql/now/

now() returns the current date and time, moved by an offset you give as text. It makes date filters that stay current, like "created in the last four weeks", without editing the query. It appears in the CQL documentation only inside examples.

## Syntax

```
now("-4w")
now()
```

## Arguments

- `offset` (optional: no): A quoted signed number followed by a unit, for example "-4w" or "-2h". Optional.

## Works with

- Fields: created and lastmodified, the two date fields that ran in our checks.
- Operators: >, >=,  with an operator error.
- Offset units that ran: m, h, d, w, M, y (lowercase except M). s, q, D and W failed.

## Examples

```
created >= now("-1w") AND space = SD AND type = page ORDER BY created DESC
```

New pages in one space over the last seven days, newest first. Run on Confluence Cloud on 2026-11-29.

```
lastmodified < now("-12w") AND type = page AND space = SD ORDER BY lastmodified ASC
```

Stale pages that nobody has touched for about three months. A starting list for a content review. Run on Confluence Cloud on 2026-11-29.

```
created > now("-4w")
```

Everything created in the last four weeks, in all spaces you can see. Run on Confluence Cloud on 2026-11-29.

```
lastmodified >= now("-1w") AND creator = currentUser()
```

Content you started that someone changed this week. Run on Confluence Cloud on 2026-11-29.

```
created >= now("-2h")
```

A narrow window for checking whether an import or an automation just created content. Run on Confluence Cloud on 2026-11-29.

```
created >= now("-1M")
```

Content from the last month. Run on Confluence Cloud on 2026-11-29.

## Pitfalls

- The functions page has no entry for now(). It shows up only in the examples for the Created field and the GREATER THAN operator, so the details on this page come from running it (checked on Confluence Cloud, November 2026).
- The offset must be a quoted string. `now(-4w)` fails with "Could not parse cql". Several parts in one string, as in `now("-4w 2d")`, fail with "Invalid relative date : -4w 2d". Use one unit, such as "-32d".
- A bad unit or an empty string gives a server error, not a clear message. `now("-4x")` fails with HTTP 500 "IllegalArgumentException executing cql", and `now("")` fails with HTTP 500 "Index 0 out of bounds for length 0". Units are case sensitive: "-1D" and "-1W" fail.
- now() must be on the right side. `now("-4w")  now()` matches nothing.

## Related

- [startOfDay()](https://goingstellar.ro/reference/cql/startofday/)
- [startOfWeek()](https://goingstellar.ro/reference/cql/startofweek/)
- [startOfMonth()](https://goingstellar.ro/reference/cql/startofmonth/)
- [created](https://goingstellar.ro/reference/cql/created-field/)
- [lastmodified](https://goingstellar.ro/reference/cql/lastmodified-field/)
- [>](https://goingstellar.ro/reference/cql/greater-than-operator/)

## Sources

- [CQL fields (Atlassian Developer, Confluence Cloud)](https://developer.atlassian.com/cloud/confluence/cql-fields/)
- [CQL operators (Atlassian Developer, Confluence Cloud)](https://developer.atlassian.com/cloud/confluence/cql-operators/)

