Include a function that returns the amount of days/weeks/months between dates

Eddie told me a trick to do this, but I would really appreciate a functions that does the job without having to use a Data to work around this missing function.

Hello,

You probably know this already, but let me ask for if somebody stumbles across this post: do you know you can get the number of days between two dates already by subtracting two dates for each other? For example, 23/01/2020 – 20/01/2020 will give 3 days as a result.

I personally find calculating with months much more interesting, because it has some nice edge cases (I love a good edge case :slightly_smiling_face: ) and different people might expect it to work slightly differently. Could you give some examples on what you would expect from such a function?

Hi,

Sorry for the late reply.

An example: depending on de time between today and the due date, the price of an upgrade is established.
The closer the due date, the lower the price for the upgrade.
Something like: the price per month times the number of months between today and the due date.

Hi,

Just pitching in a quick reply here, as it may help. First of all, we will definitely expand the number of functions in the future to make cases such as yours possible. Since I cannot give a date on this feature, here’s two different suggestions how to solve such a situation:

  1. Use periods of 4 weeks. Probably not what you want, but far easier to calculate with
  2. Subtract the start date from the end date, giving you a time span. Divide this by 30 days to get the number of months. This is a fair approximation in most cases.

Hope that helps!

Hi Jesse,

Thanks!

I’ll use that one.