As Yii as a multi database database abstraction layer I’d prefer to do not rely on mysql functions… so how else could I obtain the same result? In database I have a date or datetime field, not a timestamp.
If you don’t want to use MySQL specific functions, you could use the new DateTime class in PHP. It provides a lot of utilities for working with dates and times (even though the docs are not really complete yet).