# Working time: Excluding lunch break

**URL:** <https://community.eazybi.com/t/working-time-excluding-lunch-break/12216>\
**Category:** Questions & Answers\
**Tags:** time-dimension, eazybi, calculatedmembers\
**Created:** [March 29, 2023, 6:47am UTC](https://community.eazybi.com/t/working-time-excluding-lunch-break/12216 "2023-03-29T06:47:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![oskars.laganovskis](https://community.eazybi.com/user_avatar/community.eazybi.com/oskars.laganovskis/32/5902_2.png) [@oskars.laganovskis](https://community.eazybi.com/u/oskars.laganovskis)\
**Post date:** [March 30, 2023, 10:10am UTC](https://community.eazybi.com/t/working-time-excluding-lunch-break/12216/2 "2023-03-30T10:10:25Z")

</div>

Hi @DamianoDB,  
​  
​Welcome to the eazyBI community!  
​  
​The DateDiffWorkHours function presumes an uninterrupted business day and allows only one time interval to be provided as a function argument.  
If you have two split time intervals, there are two options.  
​  
​1) calculate morning and afternoon shift times separately and then add them together  
​2) calculate business hours during the day and then subtract business hours during the lunch break  
​  
​Both options return the same result.  
​  
​If you want to calculate the time until today for the still open issues, you might replace the empty “Closed at” with the Now() function.  
​That will require some additional processing of results to handle potential data type mismatch.  
​  
Please see below the expression for the option of morning shift + afternoon shift with included handling of empty Closed date.  
​

```auto
DateDiffWorkhours(
 [Issue].CurrentHierarchyMember.get('Created at'),
 TimestampToDate(
  CoalesceEmpty(
   DateToTimestamp([Issue].CurrentHierarchyMember.get('Closed at')),
   DateToTimestamp(Now()))),
 'default',
 '9-13')
+
DateDiffWorkhours(
 [Issue].CurrentHierarchyMember.get('Created at'),
 TimestampToDate(
  CoalesceEmpty(
   DateToTimestamp([Issue].CurrentHierarchyMember.get('Closed at')),
   DateToTimestamp(Now()))),
 'default',
 '14:30-18:30')

```

​  
​Regards,  
​Oskars / [support@eazyBI.com](mailto:support@eazyBI.com)

---

_[View the full topic](https://community.eazybi.com/t/working-time-excluding-lunch-break/12216)._
