select nodes whose created date in hours is equal or larger than 48 hours I make a PHP routine in which all node is selected and check created date and delete those nodes which is created in last 48 hours or greater.     

$result = db_query('SELECT n.nid, n.title, n.created FROM {node} n ');

foreach ($result as $record) {

        $createdDate = $record-&gt;created;
        $currentDate = time();

        $diff = $currentDate - $createdDate;
        $diff_in_hrs = ceil($diff/3600);

        if($diff_in_hrs =&gt; 48)
        {
            node_delete($record-&gt;nid);
        }
}


but i think it is a bad approach that i select all nodes (which may be 10000 nodes) and then iterate each node. i am bad in sql but i think there may be sql query through which i can get the same result.
Even quicker (and more efficient):

$sql = 'SELECT n.nid, n.title, n.created FROM {node} n WHERE (UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) -n.created)/3600 &gt;= 72');
node_delete_multiple(db_query($sql)-&gt;fetchCol());