Skip to main content


sets value for a TimePicker

setValue(value: Date | number | string | any[] | object): void;


  • value: Date | number | string | array | object - the value to be set for a timepicker


// set the value as a string

// set the value as a Date
timepicker.setValue(new Date('January 10, 2019 17:54:00'));

// set the value as an array

// set the value as a number

// set the value as an object
timepicker.setValue({hour: 10, minute: 50, AM: true});

Related sample: Timepicker. Set Timepicker value

The value of timepicker set as an array should have the following elements:

  • the hour value
  • the minutes value
  • the "AM/PM" identifier for 12-hour format as a string

The date set as a number is the number of milliseconds since January 1, 1970, 00:00:00 UTC returned by the getTime() method of the Date object.