Hi,
I am recording subscription date when user sign up using current/date time.
But I checked the database and I found subscription dates way ahead than the current date.
Is it getting the record from the users computer current date time?
Hi,
I am recording subscription date when user sign up using current/date time.
But I checked the database and I found subscription dates way ahead than the current date.
Is it getting the record from the users computer current date time?
Holy crap! This is bad
How do I set it up that it is standardize when a user sign up anywhere in the world?
You can always use a backend workflow to set that date, so you get the current date of the server.
Also have a look here for more docs about dates in bubble
It really depends on what date you think ātodayā is.
The bubble server is in western USA. So that might be yesterday.
Could use UTC. But that might be tomorrow.
I am fine with that if its in USA time. I just need everything standardized.
Any way on how to do this without using backend workflow?
If you donāt trust the clientās current date then you need to use the backend.
If you are worried about storing dates in the database all in the same format then bubble is already doing it for you.
From the docks
This type represents a precise moment in time (measured to the nearest millisecond)
The date stored in the database has nothing to do with timezones.
Displaying and doing some operations on dates depends on timezones.
When you say āway ahead than the current dateā, how much ahead are you talking about (days, weeks)? Iām guessing not more than a few hoursā¦
In any case, a date in Bubble is a timestamp⦠so it shouldnāt matter what time zone you or anyone else is in⦠the timestamp is the same (now is now, wherever you are)ā¦
So perhaps youāre getting confused by seeing that date (timestamp) formatted in a way that is different from the time zone you are in?
But the actual date (i.e. the timestamp) is fixed, and assuming youāre recording it correctly (i.e. at the precise moment a User subscribes), then whatever time zone itās being formatted in (intentionally or otherwise) is irrelevant.
Basically, what I want to happen is that when a user subscribes to a PRO plan on my app, I will catch his/her subscription date which I use so that on the 30th day of their subscription then I will renew their credits.
THe problem was when I saw PRO users and shocked to see that their subscription dates is way off!
So my entire logic of renewing subscription is a goner.
For example, a user earlier subscribed to a PRO, but I saw in DB that the subscription date is on March 01, 2023. Uh Oh!
It is totally way off
A user subscribed to a PRO plan but subscription date on DB record was March 03, 2023
How are you recording the subscription date?
This is how I save when someone converts to a PRO plan
Any advice?
This is how I renew credits on backend workflow
You are adding 30 days to the subscription date. Of course you see a date different from today
I guess you are forgetting that February has less days�
@rccanlas2
No It will only add 30 days when it only renewed after the months subscription
It shouldnāt add 30 days when on first sign up to PRO
Most of my PRO users have the correct date, only a few of them have an abnormal subscription date
No It will only add 30 days when it only renewed after the months subscription
It shouldnāt add 30 days when on first sign up to PRO
Well, evidently, thatās whatās happening (i.e. 30 days from today is 3rd March 2023)ā¦
So you need to start investigating why your workflow is triggering when you think it shouldnāt be triggering.
@adamhholmes and @dorilama , I donāt think this is the problem here, because he is adding +30 days in the end of the plan (I believe, 30 days after subscription date), and he is adding this 30 days from the date of subscription, not from current date/time.
@rccanlas2 How did you configured the āRecurring eventā to renew your userās credits?
but the Subscription date IS the current date/timeā¦
but yeah @rccanlas2 ⦠how and where are you starting the recurring workflow?.. (Iām pretty sure the answer lies thereā¦)
But the renew event only happens 30 days after the subscription is madeā¦
If this event is beeing triggered in the end of the monthā¦
The correct thing to do is to schedule the renewing workflow. Not work with recurring events.