How to use presave hook to save a field value as node title? I have a custom date field in a node type 'day'.
When the node is saved (or edited then saved), I would like to get the field_date value (not the published date) and save it into the title field.

I would like to know how, perhaps using a module to:

hook_presave


GET FIELD VALUE
SET TITLE AS FIELD VALUE
SAVE NODE
You need to implement the hook_entity_presave()

/**
 * Implements hook_entity_presave().
 */
function YOUR_MODULE_entity_presave(Drupal\Core\Entity\EntityInterface $entity) {
  switch ($entity-&gt;bundle()) {
    // Here you modify only your day content type
    case 'day':
      // Setting the title with the value of field_date.
      $entity-&gt;setTitle($entity-&gt;get('field_date')-&gt;value);
     break;
  }
}