Finds the last time a node was changed.
$nid: The ID of a node.
string $langcode: (optional) The language the node has been last modified in. Defaults to the node language.
string A unix timestamp indicating the last time the node was changed.
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;
}