Search between two dates doesn't seem to be inclusive and is missing some issues

Dave Donnelly [Sensata]
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.
September 11, 2012

Hello, I have a search string that contains:

created >= 2012-01-01 AND created <= 2012-01-31

I.e.: looking for everything that was created in January 2012. For some reason this is missing an issue that was created on the 31st of January and the string has to be modified to be:

created >= 2012-01-01 AND created <= 2012-02-01

in order to successfully include that particular issue in the results.

Note 1: There is another issue that has a created date of 5th Jan 2012 and if I change the search string to be:

created >= 2012-01-05 AND created <= 2012-01-31

then is it returned successfully.

Note 2: If I switch to simple searching then two fields are labelled:

  • Created after
  • Creader before

which doesn't sound very inclusive.

Trés confused. Anyone have an idea if I am doing something terribly stupid here???

2 answers

1 accepted

6 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
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.
September 11, 2012

Simply put, a date in JIRA's world is the date with time as 12:00AM. So "created >= 2012-01-01 AND created <= 2012-01-31" mean everything from 01/01 12:00AM to 01/31 12:00AM. That will miss all issues created on 01/31 after 12:00AM which is mostly everything created on 01/31.

Hope that explains.

Btw, you can use time as well in the query if using the next date confusing. Something like:

created >= "2012-01-01" AND created <= "2012-01-31 11:00"

Dave Donnelly [Sensata]
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.
September 11, 2012

Thanks Jobin!

krishan avtar gaur April 7, 2020

@Jobin Kuruvilla [Adaptavist]  if we are taking startOfMonth(-9) that time we can't take time{startOfMonth(-9) 11:59} because it's a group of month then how can we get missed issues????

0 votes
Mike Grote December 13, 2016

Hello,
I have the same problem, it is not possible to change the default setting in the date filter for the "TODATE" to 12:00 PM.

Thank you very much

greetings
Mike

Suggest an answer

Log in or Sign up to answer