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. For an example in
Google Chat apps, see 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:
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.
↳ 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
The default value displayed in the widget, in milliseconds since Unix epoch 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Apps Chat V1 Client - Class DateTimePicker (0.12.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.12.0 (latest)](/php/docs/reference/apps-chat/latest/Card.V1.DateTimePicker)\n- [0.11.2](/php/docs/reference/apps-chat/0.11.2/Card.V1.DateTimePicker)\n- [0.10.0](/php/docs/reference/apps-chat/0.10.0/Card.V1.DateTimePicker)\n- [0.9.0](/php/docs/reference/apps-chat/0.9.0/Card.V1.DateTimePicker)\n- [0.8.1](/php/docs/reference/apps-chat/0.8.1/Card.V1.DateTimePicker)\n- [0.7.2](/php/docs/reference/apps-chat/0.7.2/Card.V1.DateTimePicker)\n- [0.6.1](/php/docs/reference/apps-chat/0.6.1/Card.V1.DateTimePicker)\n- [0.5.0](/php/docs/reference/apps-chat/0.5.0/Card.V1.DateTimePicker)\n- [0.4.0](/php/docs/reference/apps-chat/0.4.0/Card.V1.DateTimePicker)\n- [0.3.0](/php/docs/reference/apps-chat/0.3.0/Card.V1.DateTimePicker)\n- [0.2.0](/php/docs/reference/apps-chat/0.2.0/Card.V1.DateTimePicker)\n- [0.1.4](/php/docs/reference/apps-chat/0.1.4/Card.V1.DateTimePicker) \nReference documentation and code samples for the Google Apps Chat V1 Client class DateTimePicker.\n\nLets users input a date, a time, or both a date and a time. For an example in\nGoogle Chat apps, see [Let a user pick a date and\ntime](https://developers.google.com/workspace/chat/design-interactive-card-dialog#let_a_user_pick_a_date_and_time).\n\nUsers can input text or use the picker to select dates and times. If users\ninput an invalid date or time, the picker shows an error that prompts users\nto input the information correctly.\n[Google Workspace\nAdd-ons and Chat apps](https://developers.google.com/workspace/extend):\n\nGenerated from protobuf message `google.apps.card.v1.DateTimePicker`\n\nNamespace\n---------\n\nGoogle \\\\ Apps \\\\ Card \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nThe name by which the `DateTimePicker` is identified in a form input event.\n\nFor details about working with form inputs, see [Receive form\ndata](https://developers.google.com/workspace/chat/read-form-data).\n\n### setName\n\nThe name by which the `DateTimePicker` is identified in a form input event.\n\nFor details about working with form inputs, see [Receive form\ndata](https://developers.google.com/workspace/chat/read-form-data).\n\n### getLabel\n\nThe text that prompts users to input a date, a time, or a date and time.\n\nFor example, if users are scheduling an appointment, use a label such as\n`Appointment date` or `Appointment date and time`.\n\n### setLabel\n\nThe text that prompts users to input a date, a time, or a date and time.\n\nFor example, if users are scheduling an appointment, use a label such as\n`Appointment date` or `Appointment date and time`.\n\n### getType\n\nWhether the widget supports inputting a date, a time, or the date and time.\n\n### setType\n\nWhether the widget supports inputting a date, a time, or the date and time.\n\n### getValueMsEpoch\n\nThe default value displayed in the widget, in milliseconds since [Unix\nepoch time](https://en.wikipedia.org/wiki/Unix_time).\n\nSpecify the value based on the type of picker (`DateTimePickerType`):\n\n- `DATE_AND_TIME`: a calendar date and time in UTC. For example, to represent January 1, 2023 at 12:00 PM UTC, use `1672574400000`.\n- `DATE_ONLY`: a calendar date at 00:00:00 UTC. For example, to represent January 1, 2023, use `1672531200000`.\n- `TIME_ONLY`: a time in UTC. For example, to represent 12:00 PM, use `43200000` (or `12 * 60 * 60 * 1000`).\n\n### setValueMsEpoch\n\nThe default value displayed in the widget, in milliseconds since [Unix\nepoch time](https://en.wikipedia.org/wiki/Unix_time).\n\nSpecify the value based on the type of picker (`DateTimePickerType`):\n\n- `DATE_AND_TIME`: a calendar date and time in UTC. For example, to represent January 1, 2023 at 12:00 PM UTC, use `1672574400000`.\n- `DATE_ONLY`: a calendar date at 00:00:00 UTC. For example, to represent January 1, 2023, use `1672531200000`.\n- `TIME_ONLY`: a time in UTC. For example, to represent 12:00 PM, use `43200000` (or `12 * 60 * 60 * 1000`).\n\n### getTimezoneOffsetDate\n\nThe number representing the time zone offset from UTC, in minutes.\n\nIf set, the `value_ms_epoch` is displayed in the specified time zone.\nIf unset, the value defaults to the user's time zone setting.\n\n### setTimezoneOffsetDate\n\nThe number representing the time zone offset from UTC, in minutes.\n\nIf set, the `value_ms_epoch` is displayed in the specified time zone.\nIf unset, the value defaults to the user's time zone setting.\n\n### getOnChangeAction\n\nTriggered when the user clicks **Save** or **Clear** from the\n`DateTimePicker` interface.\n\n### hasOnChangeAction\n\n### clearOnChangeAction\n\n### setOnChangeAction\n\nTriggered when the user clicks **Save** or **Clear** from the\n`DateTimePicker` interface."]]