Updated an empty field collection in Drupal7 New to Drupal and I'm assuming the answer is simple, I've looked through the test suites etc. and still missing the point it seems.

I have a node with a field collection (field_theatre_date_set) that will store a number of dates and times. I have loaded the node and the collection is there but it's empty.

I have used various forms of this and an obvious problem is that the $field_collection_item_value below array structure just isn't there.

Any further pointers greatly received.

$loop=0;
foreach($showing_array as $key=&gt;$value){

 $date='xxxx';
 $time='xxxx';

 $field_collection_item_value = $node-&gt;field_theatre_date_set[LANGUAGE_NONE][0]['value'];      
 $field_collection_item = entity_load('field_collection_item', array($field_collection_item_value)); // Load that field collection item 

 $field_collection_item-&gt;field_theatre_date_set_date[$node-&gt;language][$loop]['value'] = $date;          
 $field_collection_item-&gt;field_theatre_date_set_time[$node-&gt;language][$loop]['value'] = $time;
 $loop++
}
 $field_collection_item-&gt;save();


/**Update***/

Progress has been made. I still have an empty field_collection reference that needs to store a date and time.

I now understand that field collections store a value and a revision_id. I now need to work out how to store these revisions. I have the following code:

$field_collection_item = entity_create('field_collection_item', array('field_name' =&gt; 'field_theatre_date_set'));

$field_collection_item-&gt;setHostEntity('node', $node);
$field_collection_item-&gt;date[LANGUAGE_NONE][]['date']   = $date;
$field_collection_item-&gt;field_description[LANGUAGE_NONE][]['time']   = $time;               
$field_collection_item-&gt;save();


Now when I output the field_collection_item I see the following where I am expecting to see the the value and revision:

[field_theatre_date_set] =&gt; Array
            (
                [und] =&gt; Array
                    (
                        [0] =&gt; Array
                            (
                                [entity] =&gt; FieldCollectionItemEntity Object
 *RECURSION*
                            )

                    )

            )


And at the very bottom of the array I have the dates and times wallowing on their own:

[date] =&gt; Array
    (
        [und] =&gt; Array
            (
                [0] =&gt; Array
                    (
                        [date] =&gt; 2014-03-13
                    )

            )

    )

[time] =&gt; Array
    (
        [und] =&gt; Array
            (
                [0] =&gt; Array
                    (
                        [time] =&gt; 19:45:00
                    )

            )

    )


Any pointers on how to move them into my field_theatre_date_set if they aren't expecting date and time values? 

Thanks all for looking!
I believe you need to load and save the node to which the field collection is attached. 

This question: Modifying a field collection programmatically missing hostEntity fields is slightly different but the examples are accomplishing the same thing.