-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: in subscriptions.create, trial_days using timezone naive utcnow() #573
Comments
Nice catch! Please consider creating a PR (with a test). |
Thanks! |
miaoz2001
added a commit
to sptgps/pinax-stripe
that referenced
this issue
Jul 13, 2018
…ow() and add test Fixes pinax#573
4 tasks
pull request created |
miaoz2001
added a commit
to sptgps/pinax-stripe
that referenced
this issue
Jul 16, 2018
…ow() - Changed to timezone.now() - Add test Fixed pinax#573
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue Summary
in subscriptions.create, when calculating the trial_end value, using
However utcnow is timezone naive so the trial_end has no timezone info.
So when stripe calculate the timestamp with the code below:
It will get the wrong timestamp, which is, for example, if my local timezone is UTC+10, then the timestamp of trial_end will be 10 hours earlier.
The code should be
If this is a bug instead of a question or feature request, please fill out the sections below.
Steps to Reproduce
To re-produce, just pass the trial_days=10 in subscriptions.create()
What were you expecting to happen?
in the pinax_stripe_subscription table it shows as below
However trial_end should be 2018-07-14 01:20:49
What actually happened?
trial_end should be 2018-07-14 01:20:49
The text was updated successfully, but these errors were encountered: