DateDiff returns formatted range

Hello, is there a DateDiff function or something similar in Bubble that returns the difference between 2 dates, in a formatted range e.g.
DateTimeA-DateTimeB = x Days, y Hours, z Minutes (5 Days, 9 Hours, 32 Minutes)?

Thanks in advance

Hi there, @nate9… here is an example that uses the current user’s modified date and creation date to produce the days, hours, and minutes between those dates.

date-diff

Oh, and if you haven’t already enabled the experimental parentheses feature, you should do that first.

Hope this helps.

Best…
Mike

2 Likes

Thanks Mike, the parentheses helped a lot and exactly what I needed.

The solution itself was/is a lot more complicate. Your solution above works if you are looking for the absolute days / hours / minutes between 2 dates.

I was looking for the difference between 2 dates broken down into the days/hours/minute e.g. if you get the difference between 2 dates – you might get 24.78999 Days the .78999 equates to 18.9597 Hours and the 9597 equates to: 57 minutes. Therefor 24.789999 Days should read: 24 Days 18 Hours 57 Minutes

I got it working in the end.

Thanks for your time and effort to provide a solution.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.