#seththoburn

1 messages · Page 1 of 1 (latest)

amber muskBOT
steel sky
#

Hello! 167253120 is Sun, 20 Apr 1975 19:12:00 +0000, and 169171199 is Mon, 12 May 1975 23:59:59 +0000, so I think you might be doing something unintentional there?

#

Stripe didn't exist back in '75. 🙂

median lava
#

well when I do this I get no results:
created>1672531200000 AND created<1691711999999 AND status:"succeeded"

#

So i tried removing the milliseconds which is how stripe returns timestamps

steel sky
#

We use unix timestamps in seconds. That first timestamp above is Mon, 28 May 54970.

#

How are you generating these timestamps?

median lava
#

I put Date().getTime() / 1000

#

When I put them both in seconds, I also get no results, like so:
created>167253120 AND created<169171199 AND status:"succeeded"

steel sky
#

Again, that timestamp is in 1975. Whatever you're doing to generate timestamps is not working the way you think it is.

median lava
#

I'm pretty sure it's a bug with the api, because I just got the results I expected by doing this:
created>167253120 AND created<1691711990000 AND status:"succeeded"

Let me give you an example, your api contains the following charge:

  "id": "ch_2NdVq5yY4kfccx9p0PrdAHdi",
  "created": 1691662294
}```

What search query would you expect to contain that charge?
steel sky
#

Well, 1691662294 is Thu, 10 Aug 2023 10:11:34 +0000, which is a long time after 167253120 (Sun, 20 Apr 1975 19:12:00 +0000) and a very, very long time before 1691711990000 (Tue, 21 Mar 55578 21:13:20 +0000), so it seems expected that the search you mentioned above would work.

#

To put it another way, your search query above is searching a range of 53,603 years of time.

#

That range includes the time at which that Charge was created.

#

So it's not a bug, it's working as expected.

#

But, again, whatever you're doing to generate timestamps is not working correctly.

#

What programming language are you using?

median lava
#

typescript

steel sky
#

What's the full code you're using to get those timestamps?

median lava
#

Ok, I thought I was right but just tried something else and now think I am wrong lol

#
          query: `created>${
            fetchStart.getTime() / 1000
          } AND created<${fetchEnd.getTime()} AND status:"succeeded"`,
        })) {```
#

fetchStart is a date object from the date constructor passed a query param like this: "2023-01-01T00:00:00.000Z"

steel sky
#

So this code:

const testDate = new Date('2023-01-01T00:00:00.000Z');
console.log(testDate.getTime() / 1000);

Spits out 1672531200 for me, which is correct and what you would use with the API.

#

It sounds like maybe the fetchStart doesn't have the date you expect?

median lava
#

You know what, I think I was rounding by hand in postman to test things, and I removed an extra zero. Thanks for putting up with me lol

#

When I do it with the code it works fine