Is there a field in Drupal 8 that lets you select a time without actually selecting a date? Or should you just use datetime?
You can use datetime element and disable date widget:
$widget['time_container']['time'] = [ '#type' => 'datetime', '#title' => $this->t('Time'), '#size' => 20, '#date_date_element' => 'none', // hide date element '#date_time_element' => 'time', // you can use text element here as well '#date_time_format' => 'H:i' ];
Depending on what you want to select time for, you may want to try HMS field.
The field stores values as integer. Both input and output can be formatted as Hours, Minutes and/or Seconds. Alter functions provide a way for developers to add their own format.
Please note that this is a great field for "time durations," but not so good if you are trying to capture a time of day with PM/AM.
Timefield was a good option for capturing just time of the day, BUT it has not been ported to Drupal 8.
Hi you can use https://www.drupal.org/project/time_field module. Easy and perfect fit.