How to retrieve value of start date with format end date? I D8 installed the module Optional End Date in order to add an optional end date within a date field.

When I had a single date field value I could get the value by using:

 $datum_deelname = $node-&gt;get('field_normaldate')-&gt;value;


If I change this in the new field name:

 $datum_deelname = $node-&gt;get('field_optional_enddate')-&gt;value;


I get back NULL. 

How should I get this value?
Try using:

 $datum_deelname = $node-&gt;get('field_optional_enddate')-&gt;end_value;


This will give the optional end date.

If you want to get the normal date as you mentioned you can use as:

 $datum_deelname = $node-&gt;get('field_optional_enddate')-&gt;value;