#talker - Time Zones

1 messages · Page 1 of 1 (latest)

hybrid blade
#

Hello! The Stripe API is generally not timezone-aware. Everything uses Unix timestamps. Can you provide more details about what exactly you're trying to do or what issue you're having?

true crane
#

My company is in PST, I am in EST. For example if i schedule a subscription for 4/12/2022 00:00:00 the start date will show up in the stripe dashboard as 4/11/2022. If i change the payload and put 4/12/2022 03:00:00 only than the scheduled subscription startdate will show up as 04/12/2022

#

I am using the Stripe.Net nuget package, so far i having seen where those unix epoch seconds apply. I am thinking maybe the nuget package abstracts that.

hybrid blade
#

Can you share the code you're using? Usually you would set the timestamp as a plain integer, like StartDate = 1650320197 for example.

true crane
hybrid blade
#

Where is the code that defines startDate?

true crane
#

its passed into the function as a DateTime object

hybrid blade
#

Oh, startDate is a DateTime. Make it an integer instead which is a Unix timestamp.

true crane
#

funny thing i already tried that

#

it will not accept an integer

hybrid blade
true crane
#

i also seen that in the stripe documentation, but this causes a build error.

#

as you can see it's underlined and the build error is at the bottom of the screen

#

used the exact same example here 1650320872

dry badger
#

Hi there! Taking over for Rubeus. Give me a few minutes to get up to speed.

true crane
#

ok thanks

dry badger
#

At first glance, this looks like either an error with our docs or an error with our library. It should be able to accept an int , but it's erroring on my end as well

#

Are you able to submit using a DateTime type instead of int?

#

Alternatively, if you want to set to the time of creation, you can use StartDate = SubscriptionScheduleStartDate.Now,