short timestamp in symfony 1.4 and doctrine 1.2
I generated new project in Symfony and I used Doctrine:
expires_at: { ty开发者_开发问答pe: timestamp, notnull: true }
but it is too long for me. I need only 2011/06/05. How can I achieve this? The widget in the form is asking for too much. One must also fill in for example milliseconds.
This:
unset(
$this['expires_at']
);
deleted all field in the widget. I would like something like that remained 2011/06/05.
doctrine has a special datatype for this purpose : http://www.doctrine-project.org/documentation/manual/1_2/pl/defining-models:columns:data-types#date
Put this in your schema.yml :
expires_at: { type: date, notnull: true }
and regenerate your form.
精彩评论