---
id: "M:cAlgo.API.DateTimePicker.#ctor"
kind: "constructor"
type: "T:cAlgo.API.DateTimePicker"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/DateTimePicker/Constructor/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# DateTimePicker constructor

Member of [DateTimePicker](https://help.ctrader.com/ctrader-algo/references/Controls/DateTimePicker/index.md).

## DateTimePicker()

Initializes a new instance of the DateTimePicker class.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Accepted without error but never displayed, so control events such as Click are never raised.
- Cloud: Accepted without error but never displayed, so control events such as Click are never raised.

C#:

```csharp
public DateTimePicker()
```

Python:

```python
DateTimePicker()
```

Available since cAlgo.API 5.5.

### Examples

C#:

```csharp
var dateTimePicker = new DateTimePicker { Value = Server.Time, Width = 200 };
Chart.AddControl(dateTimePicker);
```

Python:

```python
dateTimePicker = DateTimePicker()
dateTimePicker.Value = api.Server.Time
dateTimePicker.Width = 200
api.Chart.AddControl(dateTimePicker)
```

