Add Interval to timestamp

Hi,

how would you add an interval in a database independent way?

Best would be to use the database functionality, but I don’t know a function that would work on at least mysql and postgresql. Something like ‘CURRENT_TIMESTAMP + INTERVALL’ like it is possible with postgresql.

Or do I have to use php? Or is there Yii functionality which can abstract those calculations?

Maybe CDbExpression class is your friend but I don’t know if it is database independent but I think it should.

I think unix timestamps were best for this. Calculate them via PHP and use the results in your queries.