Stripe API and UNIX Timestamps

It has been noted before that retrieving date values via the Stripe API can cause issues.

Basically Stripe dates are defined as UNIX timestamps (seconds), whereas Bubble expects milliseconds.

Solutions have been suggested:

But what I REALLY don’t understand is why this is an issue when I retrieve a date value via a GET API Call like below:

GET API Call

Resulting Value in Database

For reference, this is the API call I’m using - the “current_period_end” and “current_period_start” are set to be date (UNIX):

Annoying.

But what’s more annoying is that when I get the same values via a webhook, it seems to work absolutely fine?

Webhook pulling in subscription data

Resulting value in database

Anyone have any idea why the webhook vs. GET API call would result in different outcomes?

They should both work, so its a bug. Can you raise a bug report with Bubble while you have all the info ready?

Bubble seem more inclined to fix bugs than they have been in the past.

Regarding workarounds, did you see one that didn’t need to use a plugin? for reference
It is a really old hack, there might be an easier way by now.

1 Like

Thanks @mishav, have submitted a bug report so hopefully they can figure it out.

On another note, thanks for your plugins and all you’ve contributed to bubble over the years. :slight_smile:

1 Like