Using DATE_FORMAT in a select query
You can try \Drupal::database()-&gt;select-&gt;addExpression().

For you, below code might be useful. 

\Drupal::database()
  -&gt;select('node_field_data', 'spmw')
  -&gt;fields('spmw', ['id'])
  -&gt;addExpression("DATE_FORMAT(created,'%H:%i')", "created")
  -&gt;execute()
  -&gt;fetchObject();