# Picks\_per\_day query not reporting correct data when using "date\_from" - off by 60-80 seconds

**URL:** <https://community.shiphero.com/t/picks-per-day-query-not-reporting-correct-data-when-using-date-from-off-by-60-80-seconds/1401>\
**Category:** GraphQL API\
**Created:** [June 27, 2021, 2:12pm UTC](https://community.shiphero.com/t/picks-per-day-query-not-reporting-correct-data-when-using-date-from-off-by-60-80-seconds/1401 "2021-06-27T14:12:12Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![atlatin](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@atlatin](https://community.shiphero.com/u/atlatin)\
**Post date:** [June 27, 2021, 2:12pm UTC](https://community.shiphero.com/t/picks-per-day-query-not-reporting-correct-data-when-using-date-from-off-by-60-80-seconds/1401/1 "2021-06-27T14:12:12Z")

</div>

We run a query every 5 minutes to check on the recent picks and ensure items were all scanned and items all had weights, etc. This was working fine until a few months ago, but then we noticed that randomly now it seems to automatically be 5 minutes behind.

For example, if we run the query and use “query {picks\_per\_day(date\_from:“2021-06-25T16:58:50”)”, it will really do it from about 5 minutes and 70 seconds before that (so it would be as if we had entered “T16:52:40”.

Do you know this can be fixed? Or if this was an intentional change by the engineers, do you know the exact seconds that it is behind for that query so we can factor that into our request. Thank you!

If it is helpful, this is an example of a request\_id where you can see this (the query was date\_from: 19:08:51 but the response has results from before that time (i.e. 19:06:19) :

- request\_id = 60d62a0bd5f24b48a71ec81e

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [June 29, 2021, 2:20pm UTC](https://community.shiphero.com/t/picks-per-day-query-not-reporting-correct-data-when-using-date-from-off-by-60-80-seconds/1401/2 "2021-06-29T14:20:02Z")

</div>

Hi Atlatin,  
Apologies for the delay, and thank you for the request\_id.

---

<div class="post-metadata">

**Author:** ![kokua](https://avatars.discourse-cdn.com/v4/letter/k/9d8465/32.png) [@kokua](https://community.shiphero.com/u/kokua)\
**Post date:** [June 30, 2021, 3:57pm UTC](https://community.shiphero.com/t/picks-per-day-query-not-reporting-correct-data-when-using-date-from-off-by-60-80-seconds/1401/3 "2021-06-30T15:57:13Z")

</div>

Same.

` "request_id": "60dc93c13465fcae8269a7a0",`

` picks_per_day(date_from: "2021-06-30 10:10:00", date_to: "2021-06-30 10:11:00")`

is giving me results like…

`"created_at"=>"2021-06-30T15:06:03" "created_at"=>"2021-06-30T15:06:04" "created_at"=>"2021-06-30T15:06:12" "created_at"=>"2021-06-30T15:06:13" "created_at"=>"2021-06-30T15:06:17" "created_at"=>"2021-06-30T15:06:20" "created_at"=>"2021-06-30T15:06:24" "created_at"=>"2021-06-30T15:06:27" "created_at"=>"2021-06-30T15:06:28" "created_at"=>"2021-06-30T15:06:30" "created_at"=>"2021-06-30T15:06:32" "created_at"=>"2021-06-30T15:06:38" "created_at"=>"2021-06-30T15:06:49" "created_at"=>"2021-06-30T15:06:55"`

Further it seems I have to make requests in EST as opposed to UTC to get the results back in UTC.

@atlatin did you come up with any good workarounds?

---

<div class="post-metadata">

**Author:** ![atlatin](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@atlatin](https://community.shiphero.com/u/atlatin)\
**Post date:** [June 30, 2021, 7:25pm UTC](https://community.shiphero.com/t/picks-per-day-query-not-reporting-correct-data-when-using-date-from-off-by-60-80-seconds/1401/4 "2021-06-30T19:25:44Z")

</div>

@kokua Unfortunately we haven’t been able to figure out a good workaround. We tried randomly guessing what the offset was (i.e. X minutes or X seconds) but that doesn’t seem to work well since we can’t determine what the number is. This seems to have started being an issue around March of this year I believe.

---

<div class="post-metadata">

**Author:** ![kokua](https://avatars.discourse-cdn.com/v4/letter/k/9d8465/32.png) [@kokua](https://community.shiphero.com/u/kokua)\
**Post date:** [June 30, 2021, 7:43pm UTC](https://community.shiphero.com/t/picks-per-day-query-not-reporting-correct-data-when-using-date-from-off-by-60-80-seconds/1401/5 "2021-06-30T19:43:25Z")

</div>

@atlatin one thing I am doing for now is fetching a generous range of picks and not storing them if I already have their `node_id` instead of trying to guess the magic math.

Unsure if this affects you too, but I am noticing that I must fetch records using timestamps in EST (not even EDT) and the timestamps that come back are UTC. So this also caused an issue recently as daylight savings shifted recently as well.

---

<div class="post-metadata">

**Author:** ![atlatin](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@atlatin](https://community.shiphero.com/u/atlatin)\
**Post date:** [June 30, 2021, 9:42pm UTC](https://community.shiphero.com/t/picks-per-day-query-not-reporting-correct-data-when-using-date-from-off-by-60-80-seconds/1401/6 "2021-06-30T21:42:01Z")

</div>

@kokua that sounds like a good workaround, just unfortunately over my head on how to process in that manner (comparing to existing node\_id and then not storing).

The EST issue you mentioned is the same here and caused problems for us during the shift from daylight savings until we accounted for that hour difference.

Strange that everything was fine prior to March.

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [July 5, 2021, 8:33pm UTC](https://community.shiphero.com/t/picks-per-day-query-not-reporting-correct-data-when-using-date-from-off-by-60-80-seconds/1401/7 "2021-07-05T20:33:00Z")

</div>

I see the issues and will put this in for someone to take a look in engineering.

---

<div class="post-metadata">

**Author:** ![atlatin](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@atlatin](https://community.shiphero.com/u/atlatin)\
**Post date:** [July 21, 2021, 4:32pm UTC](https://community.shiphero.com/t/picks-per-day-query-not-reporting-correct-data-when-using-date-from-off-by-60-80-seconds/1401/9 "2021-07-21T16:32:08Z")

</div>

@Theresa I was just checking to see if any update on this so we know if we should change our setup or just wait.

---

<div class="post-metadata">

**Author:** ![Theresa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/theresa/32/377_2.png) [@Theresa](https://community.shiphero.com/u/Theresa)\
**Post date:** [July 26, 2021, 3:37pm UTC](https://community.shiphero.com/t/picks-per-day-query-not-reporting-correct-data-when-using-date-from-off-by-60-80-seconds/1401/10 "2021-07-26T15:37:37Z")

</div>

We have it in the queue, but I do not have an eta.

---

<div class="post-metadata">

**Author:** ![atlatin](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@atlatin](https://community.shiphero.com/u/atlatin)\
**Post date:** [May 11, 2022, 7:56pm UTC](https://community.shiphero.com/t/picks-per-day-query-not-reporting-correct-data-when-using-date-from-off-by-60-80-seconds/1401/11 "2022-05-11T19:56:09Z")

</div>

Just checking in to see if there is any update on this?

---

<div class="post-metadata">

**Author:** ![tomasfd](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tomasfd](https://community.shiphero.com/u/tomasfd)\
**Post date:** [May 12, 2022, 1:08pm UTC](https://community.shiphero.com/t/picks-per-day-query-not-reporting-correct-data-when-using-date-from-off-by-60-80-seconds/1401/14 "2022-05-12T13:08:29Z")

</div>

Hello @atlatin!

I will request an update from the engineering team.

Kind regards,  
TomasFD
