
## GetDuration (1 of 3) {#getduration_1}

Gets Duration object with the specified number of units and default duration format which is defined in project's settings Prj::DurationFormat .

**Returns:** Duration object.

```cpp
GetDuration(double val)
```

| Parameter | Description |
| --- | --- |
| val | specified number of units. |

---

## GetDuration (2 of 3) {#getduration_2}

Gets Duration object with the specified number of TimeUnitType units.

**Returns:** Duration object.

```cpp
GetDuration(double val, TimeUnitType timeUnit)
```

| Parameter | Description |
| --- | --- |
| val | specified number of units. |
| timeUnit | specified TimeUnitType value. |

---

## GetDuration (3 of 3) {#getduration_3}

Gets Duration object with the specified TimeSpan value and specified TimeUnitType value.

**Returns:** Duration object.

```cpp
GetDuration(System::TimeSpan timeSpan, TimeUnitType timeUnit)
```

| Parameter | Description |
| --- | --- |
| timeSpan | specified TimeSpan value. |
| timeUnit | specified TimeUnitType value. |

