Mysql Now() In Active Record Conditions

This does not work:

$criteria = new CDbCriteria;

$criteria->select = '';

$criteria->condition = 't.status = "idle" AND ';

$criteria->condition .= 't.begin < ' . new CDbExpression('NOW()');

What is the right way to pass sql NOW() function to record selection criteria???

Thank’s ahead!


This seem not working as well:

$criteria = new CDbCriteria;

$criteria->select = '';

$criteria->addCondition('t.status = "idle"');

$criteria->addCondition('t.begin < ' . new CDbExpression('NOW()'));

its working here with me…

whats the Error with you ???

OK - the issue was about stupid daylight savings…

While my system is using dynamic DTS corrections - is now at UTC + 02, MySQL is fixed to UTC + 01. Consequently, system’s “now” was not equal MySQL’s “now” and my calculations got confused…