Create a node programmatically? I found this code to create a node programmatically. It creates the node but the "title" field is not populated. 

    $body_text = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.';

  $node = new stdClass();
  $node-&gt;type = 'flats';
  node_object_prepare($node);

  $node-&gt;title    = 'Node Created on ' . date('c');
  $node-&gt;language = 'en';

  $node-&gt;body[$node-&gt;language][0]['value']   = $body_text;
  $node-&gt;body[$node-&gt;language][0]['summary'] = text_summary($body_text);
  $node-&gt;body[$node-&gt;language][0]['format']  = 'filtered_html';

  $path = 'content/my-lipsum-' . date('YmdHis');
  $node-&gt;path = array('alias' =&gt; $path);

  node_save($node);


The machine name of my Title is "title_field", but using this neither works:

  $node-&gt;title_field    = 'Node Created on ' . date('c');
Are you using https://www.drupal.org/project/title ? If that's the case you must treat it like a field:

$node-&gt;title_field[$node-&gt;language][0]['value'] = 'Node Created on ' . date('c');