How to select every date before now in timestamp?
You could just use strtotime() to get yesterday's date instead of using a DateTime object:

$yesterday = strtotime('-1 day');

$sql = 'SELECT * FROM {mytable} WHERE date &lt; :timestamp';

$result = db_query($sql, array(':timestamp' =&gt; $yesterday));