# createDate Type documentation

## TypeScript declaration

### [createDate](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L167-L190>)

**Kind:** constant

```
import { createDate } from '@siemens/element-ng/datepicker';
```

Creates a new date object on from a date with or without time.

Returns

```
(value: Date, hours?: number, minutes?: number, seconds?: number, milliseconds?: number) => Date = ...
```

```
createDate(value: Date, hours?: number = 0, minutes?: number = 0, seconds?: number = 0, milliseconds?: number = 0): Date
```

Creates a new date object on from a date with or without time.

Returns

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [value](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L168-L168>) | `Date` |  | • The date from with the year, month and day is taken. |
| [hours](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L169-L169>) (optional) | `number` | `0` | • Optional numeric value of the hours, otherwise 0. |
| [minutes](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L170-L170>) (optional) | `number` | `0` | • Optional numeric value of the minutes, otherwise 0. |
| [seconds](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L171-L171>) (optional) | `number` | `0` | • Optional numeric value of the seconds, otherwise 0. |
| [milliseconds](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L172-L172>) (optional) | `number` | `0` | • Optional numeric value of the milliseconds, otherwise 0. |

**Returns:** [Date](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date>)
