CQL function
now() in CQL: relative dates in Confluence search
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
| Argument | What it does | Optional |
|---|---|---|
offset | A quoted signed number followed by a unit, for example "-4w" or "-2h". Optional. | no |
Works with
- Fields: created and lastmodified, the two date fields that ran in our checks.
- Operators: >, >=, <, <=, = on date fields. Fields such as title or space reject > 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 DESCNew pages in one space over the last seven days, newest first.
Run on Confluence Cloud on .
lastmodified < now("-12w") AND type = page AND space = SD ORDER BY lastmodified ASCStale pages that nobody has touched for about three months. A starting list for a content review.
Run on Confluence Cloud on .
created > now("-4w")Everything created in the last four weeks, in all spaces you can see.
Run on Confluence Cloud on .
lastmodified >= now("-1w") AND creator = currentUser()Content you started that someone changed this week.
Run on Confluence Cloud on .
created >= now("-2h")A narrow window for checking whether an import or an automation just created content.
Run on Confluence Cloud on .
created >= now("-1M")Content from the last month.
Run on Confluence Cloud on .
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 innow("-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", andnow("")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") < createddoes not parse.now()with no argument runs and means the current moment, socreated > now()matches nothing.