Display a field from a content type which is not displayed in the current node I can add new variables to the node (like day, month, year) based on current node->created. The problem is I need to display the date field from another content type which is not displayed on the page. How do I fetch it from there?

Here is my code so far:

  function mytheme_preprocess_node(&amp;$vars) {
        $node = $vars['node'];
        $vars['year'] = format_date($node-&gt;created, 'custom', 'Y' );
        $vars['month'] = format_date($node-&gt;created, 'custom', 'm' );
        $vars['day'] = format_date($node-&gt;created, 'custom', 'd' );
      }


and I display them in node.tpl.php simply printing them as $day, $month, $year. I am interested in finding an answer. Thanks.
I think you're looking for the node_load function.
Example:

function mytheme_preprocess_node(&amp;$vars) {
  // Load node with ID 123.
  $another_node = $node_load(123);
  // Format a date.
  $vars['another_node_created'] = format_date($another_node-&gt;created, 'custom', 'Y, m, d' );
}


Beware that node_load returns raw data from the database. While $another_node-&gt;created is a safe value to use, user entered data (eg. the title or body text) needs to be checked before you print it (eg. &lt;?php print check_plain($another_node-&gt;title); ?&gt;). Not checking raw data is a security risk for your site. See Handle text in a secure fashion for more info.