Skip to main content
Question

How to get difference of days and hours in two dates


Forum|alt.badge.img+8

I want to get difference of days in two dates in business rule expression. for example  I have two dates 2024-05-14 13:28:10  and 2024-05-16 09:28:10 in the columns time_commit.start_dttm and time_commit.commit_dttm respectively. I want to get the difference of their days (for this case it is 2) and difference of their hours (for this case 4 hours).

 

Please note that I tried to use value type rule. I also created a view which will give this required result but the view is not working with value type it seems. 

Any advise will be appreciated.

2 replies

Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28
  • Superhero (Employee)
  • 1131 replies
  • May 15, 2024

Hi @TDCMANIRUL 

  1. In my opinion, creating a view is the best solution.
  2. If not, you can use the expression part in the BR and subtract one date from another.
  3. Use perform_evaluate_expression

In any case, you will need to manipulate your answer to show the days/hours

 

Cheers!


Forum|alt.badge.img+8
  • Author
  • Do Gooder (Customer)
  • 20 replies
  • May 23, 2024

Hi @Shneor Cheshin ,

I will try this. Thank you.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings