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

Forums Designer Feature requests Include a function that returns the amount of days/weeks/months between dates

  • Post
    René Stout
    Participant

    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 oround this missing function.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Replies
    triggre
    Keymaster
    Up
    1
    Down

    Hello René,

    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 🙂 ) and different people might expect it to work slightly differently. Could you give some examples on what you would expect from such a function?

    René Stout
    Participant
    Up
    0
    Down

    Hi Antoine,

    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.

    • This reply was modified 1 year, 6 months ago by René Stout.
    Jesse Meijers
    Keymaster
    Up
    1
    Down

    Hi René,

    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!

    René Stout
    Participant
    Up
    0
    Down

    Hi Jesse,

     

    Thanks!

    I’ll use that one.

Viewing 4 replies - 1 through 4 (of 4 total)

Tagged: 

  • The topic ‘Include a function that returns the amount of days/weeks/months between dates’ is closed to new replies.

Get started for free and experience the power of the Triggre platform.

By signing up for your free account, you agree to receive e-mails from Triggre.

By using our site you agree to our use of cookies to deliver a better site experience.