Get peak hour duration between start and end date

38 Views Asked by At

I have been trying writing a logic for getting peak hour duration between two dates.

e.g if for certain service peak hour time is between 2000 hrs to 2200hrs (HHmm format). If start date is 26 Jun 2023 19:00:00 and end date is 26 Jun 2023 22:30:00

How can I get the duration of peak hours and normal hours usage between start and end date?

In the above example, the peak hours should be 2 hrs and normal hours should be 1.30 hrs.

0

There are 0 best solutions below