I want to format the created_at field date from the original for something like 03.May.2011 to be shown in the indexSuccess.php and in the showSuccess.php
Could you help me?
thanks
You can make in symfony in your indexSuccess.php and showSuccess.php instead of for example:
<?php $value->getCreatedAt() ?>
next:
<?php echo date('d.M.Y', strtotime($value->getCreatedAt())) ?>
You can use other formats.
The format of some data absolutely not belongs into controller context - so please use
use_helper("date");
echo format_date($myDate);
from symfony's date helper in your template (showSuccess.php, blaSuccess.php) or partial (form.php, list.php, test.php) !
You'll find more informations here http://www.symfony-project.org/gentle-introduction/1_4/en/13-I18n-and-L10n#chapter_13_sub_outputting_data_in_the_user_s_culture or in the source file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With