Skip to main content
Question

How to get difference of days and hours in two dates

  • 14 May 2024
  • 2 replies
  • 49 views

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

Userlevel 7
Badge +26

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!

Userlevel 3
Badge +7

Hi @Shneor Cheshin ,

I will try this. Thank you.

Reply