Do all Between Date functions return always positive value?

1
1. I found, with some surprise, that betweenMinutes(date1, date2) is positive regardless of the date values. I was expecting an actual time difference and negative values as well, depending on the parameters values. After careful review of the documentation (v. 7 but also v. 9) I found only a note for daysBetween function that it returns a positive decimal. For minutesBetween there is no such note. If it is true for all the functions, I think the documention should be updated to make it clear at first glance.  
asked
2 answers
1

It is indeed true, and it makes sense, too. No matter which one you put first, you're asking for the number of minutes between two times. The number of minutes is always positive, because you can't have a negative amount of “space” between two things – the least you can have is 0, when things are touching (though one could argue that a negative value would be appropriate if two things overlap).

I agree that it would be nice to have this added to the documentation, though.

answered
0

It is true, because the difference between two values is positive.

The documentation is on GitHub if you want to make a change and submit it back to Mendix. If accepted, you earn extra points, and you’ll be helping the community as others may be thinking the same as you.

answered