function node_last_changed

Finds the last time a node was changed.

Parameters

$nid: The ID of a node.

string $langcode: (optional) The language the node has been last modified in. Defaults to the node language.

Return value

string A unix timestamp indicating the last time the node was changed.

1 call to node_last_changed()

File

drupal/core/modules/node/node.module, line 1799
The core module that allows content to be submitted to the site.

Code

function node_last_changed($nid, $langcode = NULL) {
  $language_clause = isset($langcode) ? 'langcode = :langcode' : 'default_langcode = 1';
  $result = db_query('SELECT changed FROM {node_field_data} WHERE nid = :nid AND ' . $language_clause, array(
    ':nid' => $nid,
    ':langcode' => $langcode,
  ))
    ->fetch();
  return is_object($result) ? $result->changed : FALSE;
}