265
Views
4
Comments
Solved
how to find difference of two date time attributes
Question
Application Type
Reactive

Hello everyone,

im developing reactive web app.

i need to find difference between dates between two datetime attributes.

so that if manager approves in the same date then i should get decimal value like with hour or if manager approves in minutes i should get decimal value.

im using diffdays() but if manager approves on same day im getting zero value. instead of this based on time i should get some value.


can someone help me here.


Regards.

2018-10-29 08-31-03
João Marques
 
MVP
Solution

Hi Salman,


You can use DiffDays() and if it is 0, you check DiffHours(). And if it is 0, you check DiffMinutes(). Something like in the logic flow below:


If you want to get in decimals, like 0.5 days, you just need to divide the number of hours by 24, and divide the minutes by 60, to get its amount in hours.


Now that you have the tools, you just need to articulate the logic to your precise use case.


Kind Regards,
João

UserImage.jpg
Bilalhussaini Sayyed

Hi ,

Thanks for responding.

im working in aggregate. pls check below snippet whether its correcet or not . im not getting value pls check below snippet.


Regards.

2025-04-17 05-42-16
Ajit Kurane
Solution

Hi Salman,

Please find attached oml. Implemented in the same way as suggested above by @João Marques 

You can change it as per your use case.

Thanks.

Difference.oml
UserImage.jpg
Bilalhussaini Sayyed
Solution

hi ajit,

thanks for responding. but its my mistake.


im working in aggregate.. im using below to get days pls check if its correct or not.


Regards.

UserImage.jpg
Bilalhussaini Sayyed
Solution

hi ajit,

thanks for responding. but its my mistake.


im working in aggregate.. im using below to get days pls check if its correct or not.


Regards.

2018-10-29 08-31-03
João Marques
 
MVP
Solution

Hi Salman,


You can use DiffDays() and if it is 0, you check DiffHours(). And if it is 0, you check DiffMinutes(). Something like in the logic flow below:


If you want to get in decimals, like 0.5 days, you just need to divide the number of hours by 24, and divide the minutes by 60, to get its amount in hours.


Now that you have the tools, you just need to articulate the logic to your precise use case.


Kind Regards,
João

UserImage.jpg
Bilalhussaini Sayyed

Hi ,

Thanks for responding.

im working in aggregate. pls check below snippet whether its correcet or not . im not getting value pls check below snippet.


Regards.

2025-04-17 05-42-16
Ajit Kurane
Solution

Hi Salman,

Please find attached oml. Implemented in the same way as suggested above by @João Marques 

You can change it as per your use case.

Thanks.

Difference.oml
UserImage.jpg
Bilalhussaini Sayyed
Solution

hi ajit,

thanks for responding. but its my mistake.


im working in aggregate.. im using below to get days pls check if its correct or not.


Regards.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.