how to specify a timestamp including seconds in cql

Lukas Knoch -Rumpelcoders-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 29, 2015

Hi, i am currently trying to write a rest api request against the /content/search endpoint. In the cql section, you can specify a constraint to the creation date in the from

created > now("-3w")
or
created > "2015-06-10 14:30"

but i am not able to specify seconds in that constraint.

In JIRA the documentation states that milliseconds since epoch is used if the quotation marks are omitted. This does not seem to work in confluence.

Does anyone know how to specify an exact time stamp including seconds in cql?

Thanks for your help,

Lukas

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Stephen Deutsch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 30, 2015

Unfortunately it doesn't seems like the standard search format allows for it.

However, after testing out a lot of things, I finally figured out how to do it, although it's not very pretty.  I discovered that the "text" CQL field performs the exact same search as a regular search field (i.e. the search in the menubar).  This means you can use the old Confluence search syntax, which allows you to search based to the second.  Therefore, if you search for something like this:

text ~ "created:[20150610143026 TO 20151231]"

it will return all pages created later than 2015/06/10 14:30:26 GMT/UTC.  You can keep adding numbers and it should go down to milliseconds too.  Make sure you pay attention to the fact that you have to convert the search request to UTC time.

Lukas Knoch -Rumpelcoders-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 30, 2015

Thanks a lot for your support! Much appreciated!

TAGS
AUG Leaders

Atlassian Community Events