Skip to main content
1 of 3

Off-by-one error in fromdate processing

When running a query with a given fromdate value, values which match fromdate - 1 are returned.

An example: When using fromdate=1367715851 results will be returned which have a creation_date of 1367715850. However, when fromdate=1367715852 the erroneous result is no longer returned.

This API call reproduces the problem:

http://api.stackexchange.com/docs/answers-on-questions#fromdate=1367715851&order=desc&sort=activity&ids=504991&filter=withbody&site=serverfault&run=true

The expected result is an empty list of items, as in the call for fromdate=1367715852:

http://api.stackexchange.com/docs/answers-on-questions#fromdate=1367715852&order=desc&sort=activity&ids=504991&filter=withbody&site=serverfault&run=true

And only fromdate=1367715850 or less should return this result.