#ebellotpu6_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1303704287829954571
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
What's the sub_xxx ID?
cus_QnjnlS07yaYp4B has a few subscriptions, so want to make sure I'm checking the right one
the subscription is sub_1PyCD1Dbw9778AEfr8m6kbhT and the invoice subscription created on 31th is in_1QFjwsDbw9778AEfzlKbJ5VZ
sorry, it was created on 30th at 23:01
To confirm, you set billing_cycle_anchor: '1727733600' (2024-09-30 22:00:00) on creation and you're confused why the invoice for the next period was created an hour later?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
FWIW, the timestamps in our API are all UTC which isn;'t subject to daylight savings. Hopefully obviously whatever part of the world you're in may be subject to DST so the local time you receive the event may differ throughout the year, yes
but in my code I have specified that I wanted to use UTC:
int year = subscription.StartDate.Year;
int month = (subscription.StartDate.Month + 1) % 12;
if (month == 1) year = year + 1;
if (month == 0) month = 12;
var startMonth = new DateTime(year, month, 1, 0, 0, 0, DateTimeKind.Utc);
Yep, and the new invoice was created on that UTC timestamp (2024-10-30 22:01:07 UTC) as reflected here on the invoice.created event: https://dashboard.stripe.com/events/evt_1QFjwtDbw9778AEfq2wZcoVQ
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Not sure where you're seeing 23:01 โ the Dashboard?
sorry, maybe because I am in Ireland?
That doesn't answer my question? Where do you see 23:01 as the time the invoice was created
hi! I'm taking over this thread.
the time you see in your dashboard is not using the UTC tiemzone.
how can I change it?
I don't think you ca change it, it's set automatically based on you account's country.
So, the problem is not that. The problem is that I have configured the subscription to create the invoice on the 1st day of the month, and I don't know why, this invoice has been created on 30th Oct
having a look
when you created the Subscription, you set billing_cycle_anchor: "1727733600", which is exactly at midnight. so when the time changes, the Invoice is created one day earlier.
to avoid this, make set the billing_cycle_anchor at 4 or 5am.
okey
Can you confirm me that this should resolve any future problem?
But for this reason, every subscription should have created the invoice on 30th and not in 1st no?
not sure, depends really since different places and surfaces might show the dates differently
I have to give my customer a reason why it happened...
likely something to do with timestamps and timezones, I'm sorry I don't have a deeper answer at the moment
Could you forward my question to someone who can answer it?
sorry I'm just taking over from @upbeat rampart as it's too busy in other threads , and it's also busy for me on other workstreams so we just don't have the bandwidth right now to answer. Not your fault or anything
I'd suggest opening a support ticket at https://support.stripe.com/?contact=true so someone can dig in deeper and give a more async answer