
**Inheritance:**
java.lang.Object
```
public class WorkUnit
```

Represents working hours.
## Constructors

| Constructor | Description |
| --- | --- |
| [WorkUnit(Date from, Date to)](#WorkUnit-java.util.Date-java.util.Date-) | Initializes a new instance of the [WorkUnit](../../com.aspose.tasks/workunit) class. |
## Methods

| Method | Description |
| --- | --- |
| [getFrom()](#getFrom--) | Gets the From date. |
| [getTo()](#getTo--) | Gets the To date. |
| [getWorkingHours()](#getWorkingHours--) | Gets the duration of working hours. |
| [setFrom(Date value)](#setFrom-java.util.Date-) | Sets the From date. |
| [setTo(Date value)](#setTo-java.util.Date-) | Sets the To date. |
| [setWorkingHours(double value)](#setWorkingHours-double-) | Sets the duration of working hours. |
### WorkUnit(Date from, Date to) {#WorkUnit-java.util.Date-java.util.Date-}
```
public WorkUnit(Date from, Date to)
```


Initializes a new instance of the [WorkUnit](../../com.aspose.tasks/workunit) class. Creates new WorkUnit object with the specified From and To dates.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| from | java.util.Date | Start date of working hours. |
| to | java.util.Date | Finish date of working hours. |

### getFrom() {#getFrom--}
```
public final Date getFrom()
```


Gets the From date.

**Returns:**
java.util.Date - the From date.
### getTo() {#getTo--}
```
public final Date getTo()
```


Gets the To date.

**Returns:**
java.util.Date - the To date.
### getWorkingHours() {#getWorkingHours--}
```
public final double getWorkingHours()
```


Gets the duration of working hours.

**Returns:**
double - the duration of working hours.
### setFrom(Date value) {#setFrom-java.util.Date-}
```
public void setFrom(Date value)
```


Sets the From date.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | java.util.Date | the From date. |

### setTo(Date value) {#setTo-java.util.Date-}
```
public final void setTo(Date value)
```


Sets the To date.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | java.util.Date | the To date. |

### setWorkingHours(double value) {#setWorkingHours-double-}
```
public final void setWorkingHours(double value)
```


Sets the duration of working hours.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | double | the duration of working hours. |

