Answer the question
In order to leave comments, you need to log in
How to calculate the monthly billing date?
A project in which there will be the possibility of paying for access to the service for various periods of time (a month, three months, 6 months, a year). How to calculate the date until which the subscription will be valid? Count the month as 30 days and proceed from this date, or start from the date of the month? Maybe there are some standards that everyone adheres to?
Answer the question
In order to leave comments, you need to log in
Do like other services. For example: if today is 03.11.2021 21:33, a subscription for 1 month will be by 03.12.2021 21:33, for 3 months - 03.02.2022, for half a year (6 months) - 03.05.2022, etc. I consider this as a standard and, frankly, I don’t even know of services that work differently.
it’s easier to get attached to the payment system, although, of course, flexible payments allow you to write off any amount on any date, inflexible ones - plus days
, the fact is that there is no month like that in periods
, but 31 91 185 365 days - very even
if greedy - 30 90 180 365
In the programming language in which the project is being made, find a function that changes the date / time for the specified interval: ИЗМЕНДАТА(месяц, +1, ДатаНачалаПериода)
for example.
They do it this way and that. If you are claiming a subscription of "X months", then you need to count calendar months. That is, the same date of the month in X months.
And if you declare a subscription for "X days", then you need to count by calendar days.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question