You've got a couple of options:
- Overwrite
Zend_Db_Table_Row_Abstract::__get()
in your table when asking for the reg_date
- Format it in the view with your own view helper, something like
<?= $this->formatDate($this->row->reg_date, 'fancy'); ?>
Doctrine probably has the answer you would like, the following is cut from http://www.doctrine-project.org/documentation/manual/1_2/en/introduction-to-models#generating-models:
class User extends BaseUser
{
public function setPassword($password)
{
return $this->_set('password', md5($password));
}
}
$user = new User();
$user->username = 'jwage';
$user->password = 'changeme';
echo $user->password; // outputs md5 hash and not changeme
If I were you, I'd go with the view helper-option. You could add custom CSS there and have it all ready to go. If you'd need it changed, you'd change it in one place and your application's renewed.
Besides, if you ever wanted to do something with the date (compare it to another date, get just the month, localize it, etc.) you want a clean starting point which is what you'd store in the database (i.e. 2010-05-16
or 2010-05-16 16:55:00
). Therefore: view settings belongs in the view.