How to select only time without attaching a date?
You can use datetime element and disable date widget:

$widget['time_container']['time'] = [
  '#type' =&gt; 'datetime',
  '#title' =&gt; $this-&gt;t('Time'),
  '#size' =&gt; 20,
  '#date_date_element' =&gt; 'none', // hide date element 
  '#date_time_element' =&gt; 'time', // you can use text element here as well 
  '#date_time_format' =&gt; 'H:i'
];