Stripe - Get data - Subscription - Retrieve; not returning correct data

Hi everyone.
Using Stripe - Get data plugin to try and retrieve subscription end dates and other values.
Currently I can retrieve things like the subscription id, plan name, and other basic values, meaning that the API and Stripe are talking to each other, however when I try and retrieve “current_period_end” it returns the same date as below (in 1970).

I have tried with both a restricted key, secret key, and publishable key, as well as putting Bearer infront of these keys, with no luck.

Can anyone suggest why im being sent back to the future with these dates?

stripe 1

Merry Christmas :slight_smile:

Chris

Hey @cmccray, not sure if you’re still looking for your answer or figured it out by yourself, but just in case: Stripe returns the date in epoch time (time elapsed since January 1, 1970) in secondes, while Bubble expects milliseconds.

So the workaround is to get your Stripe data as a number (instead of a date), and add that to “current date/time change year to 1970, change month to 1, change day to 1, change hours to 0, change minutes to 0, change seconds to [your Stripe date formatted as a number]”.

See also this post.

1 Like