CQL function
endOfDay() in CQL: syntax and examples for Confluence
endOfDay() is the boundary that closes the current day. Use it as the upper bound of a daily window, or with "-1d" to mean the end of yesterday. It pairs with startOfDay() when you need a closed range.
Syntax
endOfDay()
endOfDay("inc")
Arguments
| Argument | What it does | Optional |
|---|---|---|
inc | Optional offset in the form (+/-)nn(y|M|w|d|h|m): y year, M month, w week, d day, h hour, m minute. Quoted. With no sign, plus is assumed. The unit is required and case sensitive, and the offset moves the boundary. | no |
Works with
- Fields: created, lastmodified
- Operators: =, !=, >, >=, <, <=
- Not with: ~, !~, IN, NOT IN (checked on Confluence Cloud, November 2026:
created ~ endOfDay()is rejected)
Examples
created > endOfDay("-1d")Content created since the end of yesterday, which means today only. This is the documentation example.
Run on Confluence Cloud on .
lastmodified > endOfDay("-1d") AND lastmodified <= endOfDay()Edits made during today, with an upper bound so the query stays correct if you later paste it into a dated report.
Run on Confluence Cloud on .
lastmodified <= endOfDay("-1d") AND type = page AND space = SDPages as they stood before today began. Useful as a baseline when you compare today against what existed yesterday.
Run on Confluence Cloud on .
type = attachment AND created > endOfDay("-7d")Files uploaded in the last week, counting from the end of the day seven days ago.
Run on Confluence Cloud on .
created < endOfDay() AND ancestor = 32964613 ORDER BY created DESCEvery page under the handbook up to and including today, newest first.
Run on Confluence Cloud on .
Pitfalls
- The value is not 23:59. On the Confluence Cloud site checked in November 2026,
endOfDay()resolved to 00:00 of the following day, andendOfDay("-1d")to 00:00 today (found throughtype = endOfDay(), which rejects the value and prints it). - Because the boundary is the next midnight, an equality such as
created = endOfDay()hardly ever matches anything. Use<=or>with it. - Offsets need a unit and are case sensitive. A bare
"-1"fails with "Invalid relative date : -1", and"-1H"with HTTP 500. - The documentation's "See also" list for startOfDay() leaves out endOfDay(), so a reader following those links never reaches this function.