# endOfDay() in CQL: syntax and examples for Confluence

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

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

- `inc` (optional: no): 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.

## 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 2026-11-29.

```
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 2026-11-29.

```
lastmodified <= endOfDay("-1d") AND type = page AND space = SD
```

Pages as they stood before today began. Useful as a baseline when you compare today against what existed yesterday. Run on Confluence Cloud on 2026-11-29.

```
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 2026-11-29.

```
created < endOfDay() AND ancestor = 32964613 ORDER BY created DESC
```

Every page under the handbook up to and including today, newest first. Run on Confluence Cloud on 2026-11-29.

## 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, and `endOfDay("-1d")` to 00:00 today (found through `type = 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.

## Related

- [startOfDay()](https://goingstellar.ro/reference/cql/startofday/)
- [endOfWeek()](https://goingstellar.ro/reference/cql/endofweek/)
- [endOfMonth()](https://goingstellar.ro/reference/cql/endofmonth/)
- [created](https://goingstellar.ro/reference/cql/created-field/)
- [lastmodified](https://goingstellar.ro/reference/cql/lastmodified-field/)
- [now()](https://goingstellar.ro/reference/cql/now/)

## Sources

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

