0.31.0 (latest) 0.30.0 0.29.0 0.28.0 0.27.0 0.23.0 0.20.0 0.19.0 0.18.0 0.17.1 0.16.1 0.15.0 0.14.0 0.13.1 0.12.1 0.11.2 0.10.0 0.9.0 0.8.1 0.7.2 0.6.1 0.5.0 0.4.0 0.3.0 0.2.0 0.1.4 Reference documentation and code samples for the Google Apps Chat V1 Client class DateTimePicker.

Lets users input a date, a time, or both a date and a time.

Supports form submission validation. When `Action.all_widgets_are_required`
is set to `true` or this widget is specified in `Action.required_widgets`,
the submission action is blocked unless a value is selected. For an example
in Google Chat apps, see [Let a user pick a date and
time](https://developers.google.com/workspace/chat/design-interactive-card-dialog#let_a_user_pick_a_date_and_time).
Users can input text or use the picker to select dates and times. If users
input an invalid date or time, the picker shows an error that prompts users
to input the information correctly.
[Google Workspace
add-ons and Chat apps](https://developers.google.com/workspace/extend):

Generated from protobuf message `google.apps.card.v1.DateTimePicker`

## Namespace

Google \\ Apps \\ Card \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` The name by which the `DateTimePicker` is identified in a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/workspace/chat/read-form-data). |
| `↳ label` | `string` The text that prompts users to input a date, a time, or a date and time. For example, if users are scheduling an appointment, use a label such as `Appointment date` or `Appointment date and time`. |
| `↳ type` | `int` Whether the widget supports inputting a date, a time, or the date and time. |
| `↳ value_ms_epoch` | `int|string` Optional. The default value displayed in the widget, in milliseconds since [Unix epoch time](https://en.wikipedia.org/wiki/Unix_time). Specify the value based on the type of picker (`DateTimePickerType`): \* \* `DATE_AND_TIME`: a calendar date and time in UTC. For example, to represent January 1, 2023 at 12:00 PM UTC, use `1672574400000`. \* \* `DATE_ONLY`: a calendar date at 00:00:00 UTC. For example, to represent January 1, 2023, use `1672531200000`. \* \* `TIME_ONLY`: a time in UTC. For example, to represent 12:00 PM, use `43200000` (or `12 * 60 * 60 * 1000`). |
| `↳ timezone_offset_date` | `int` The number representing the time zone offset from UTC, in minutes. If set, the `value_ms_epoch` is displayed in the specified time zone. If unset, the value defaults to the user's time zone setting. |
| `↳ on_change_action` | `Action` Triggered when the user clicks **Save** or **Clear** from the `DateTimePicker` interface. |

### getName

The name by which the `DateTimePicker` is identified in a form input event.

For details about working with form inputs, see [Receive form
data](https://developers.google.com/workspace/chat/read-form-data).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

The name by which the `DateTimePicker` is identified in a form input event.

For details about working with form inputs, see [Receive form
data](https://developers.google.com/workspace/chat/read-form-data).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLabel

The text that prompts users to input a date, a time, or a date and time.

For example, if users are scheduling an appointment, use a label such as
`Appointment date` or `Appointment date and time`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setLabel

The text that prompts users to input a date, a time, or a date and time.

For example, if users are scheduling an appointment, use a label such as
`Appointment date` or `Appointment date and time`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getType

Whether the widget supports inputting a date, a time, or the date and time.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [DateTimePickerType](https://docs.cloud.google.com/php/docs/reference/apps-chat/latest/Card.V1.DateTimePicker.DateTimePickerType.md.txt). |

### setType

Whether the widget supports inputting a date, a time, or the date and time.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [DateTimePickerType](https://docs.cloud.google.com/php/docs/reference/apps-chat/latest/Card.V1.DateTimePicker.DateTimePickerType.md.txt). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getValueMsEpoch

Optional. The default value displayed in the widget, in milliseconds since
[Unix epoch time](https://en.wikipedia.org/wiki/Unix_time).

Specify the value based on the type of picker (`DateTimePickerType`):

- `DATE_AND_TIME`: a calendar date and time in UTC. For example, to represent January 1, 2023 at 12:00 PM UTC, use `1672574400000`.
- `DATE_ONLY`: a calendar date at 00:00:00 UTC. For example, to represent January 1, 2023, use `1672531200000`.
- `TIME_ONLY`: a time in UTC. For example, to represent 12:00 PM, use `43200000` (or `12 * 60 * 60 * 1000`).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|string` |   |

### hasValueMsEpoch

### clearValueMsEpoch

### setValueMsEpoch

Optional. The default value displayed in the widget, in milliseconds since
[Unix epoch time](https://en.wikipedia.org/wiki/Unix_time).

Specify the value based on the type of picker (`DateTimePickerType`):

- `DATE_AND_TIME`: a calendar date and time in UTC. For example, to represent January 1, 2023 at 12:00 PM UTC, use `1672574400000`.
- `DATE_ONLY`: a calendar date at 00:00:00 UTC. For example, to represent January 1, 2023, use `1672531200000`.
- `TIME_ONLY`: a time in UTC. For example, to represent 12:00 PM, use `43200000` (or `12 * 60 * 60 * 1000`).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTimezoneOffsetDate

The number representing the time zone offset from UTC, in minutes.

If set, the `value_ms_epoch` is displayed in the specified time zone.
If unset, the value defaults to the user's time zone setting.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setTimezoneOffsetDate

The number representing the time zone offset from UTC, in minutes.

If set, the `value_ms_epoch` is displayed in the specified time zone.
If unset, the value defaults to the user's time zone setting.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getOnChangeAction

Triggered when the user clicks **Save** or **Clear** from the
`DateTimePicker` interface.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Action|null` |   |

### hasOnChangeAction

### clearOnChangeAction

### setOnChangeAction

Triggered when the user clicks **Save** or **Clear** from the
`DateTimePicker` interface.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Action` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |