How can I use 'format_type' => 'custom' for a datetime field? I have a custom entity with (among others) a field defined this way:  

$fields['duedate'] = BaseFieldDefinition::create('datetime')
  -&gt;setLabel(t('Due Date'))
  -&gt;setSetting('datetime_type', 'date')
  -&gt;setDefaultValue(array(0 =&gt; array(
    'default_date_type' =&gt; 'now',
    'default_date' =&gt; '2050-12-31',
  )))
  -&gt;setDisplayOptions('view', [
  'type' =&gt; 'datetime_default',
  'settings' =&gt; [
    'format_type' =&gt; 'date_courte',
  ],
    'weight' =&gt; 5,
  ])
  -&gt;setDisplayOptions('form', array(
    'weight' =&gt; 5,
  ))
  -&gt;setDisplayConfigurable('form', TRUE)
  -&gt;setDisplayConfigurable('view', TRUE);


'date_courte' is a custom date format I created to display date as 'dd/mm/yyyy'. And it works!
I'd like to have the same result without using 'date_courte' so I tried  

  'settings' =&gt; [
    'format_type' =&gt; 'custom',
    'format' =&gt; 'd/m/Y',
  ],


instead of

  'settings' =&gt; [
    'format_type' =&gt; 'date_courte',
  ],


And it doesn't work!  

I'm pretty sure of 'format_type' =&gt; 'custom'.
I think the problem comes from 'format' in 'format' =&gt; 'd/m/Y'. 

What should be the correct syntax?
I'm pretty sure you need to use the datetime_custom display type vs datetime_default. You won't need to pass the format_type parameter in your settings array. You will end up with something like:

...
-&gt;setDisplayOptions('view', [
  'type' =&gt; 'datetime_custom',
  'settings' =&gt; [
    'date_format' =&gt; 'd/m/Y',
  ],
...


That should work how you'd like. The datetime_custom formatter is defined in core's datetime module.