How to save autocomplete and date type fields while adding node programmatically? I am creating a node programmatically and I have a field which is autocomplete and has number of values set to unlimited.

In the code for adding the node programmatically ,the code is as given below 

    $node-&gt;field_user[]['value'] = $user-&gt;name;
       $node-&gt;field_time[]['value'] = date('m-d-Y H:i', REQUEST_TIME);
  $trans_node-&gt;field_download_flag[0]['value'] = 'YES';


So after programmatically creating a view when I check into the 'find content' place I see a node being generated but when I click on the link(where the content title is )( not on the edit link) , I cannot see the field_user in the view list

field_time
type: date 
widget : popup calendar
no of values : unlimited. 

field_date
type: Entity Reference 
widget : Autocomplete 
no of values : unlimited. 

field_flag
type: boolean 
widget : checkbox/radiobutton 
no of values : unlimited. 

I think the code for field_user should be as 

$node-&gt;field_user[]['target_id'] =  $user-&gt;name;


but still i am getting error that is WSOD
I think

$node-&gt;field_user['und'][]['target_id']


and

$node-&gt;field_time['und'][]['value']


is the good way