'Gerrit time search operators is not working when specify to second
If i'm using
/changes/?q=status:merged+after:2018-08-25
it can return the result,
however if using
/changes/?q=status:merged+after:2018-08-25 00:00:00
it returns []
According to document, it is able to search time like this.
[[after_since]]
after:'TIME'/since:'TIME'::
+
Changes modified after the given 'TIME', inclusive. Must be in the
format `2006-01-02[ 15:04:05[.890][ -0700]]`; omitting the time defaults
to 00:00:00 and omitting the timezone defaults to UTC.
How to query when specify time to second? Is my format of parameters wrong?
Solution 1:[1]
When using:
/changes/?q=status:merged+after:2018-08-25 00:00:00
only the 2018-08-25 part is being used as the after: value. The 00:00:00 part is being used as a free text query term.
The value of after: should be enclosed in quotes:
/changes/?q=status:merged+after:"2018-08-25 00:00:00"
Solution 2:[2]
I was getting 400 Bad Request errors when running:
/changes/?q=status:merged+after:2018-08-25 00:00:00
What solved it is to enclose the time in quotes, but I also needed to replace the space between the date and time with the plus sign. E.g.:
/changes/?q=status:merged+after:"2018-08-25+00:00:00"```
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | David Pursehouse |
| Solution 2 | asherbret |
