I want to format the created_at field date from the original to something like 15h33 12/01/2012 to be shown in the indexSuccess.php.
Could you help me?
I want to format the created_at field date from the original to something like 15h33 12/01/2012 to be shown in the indexSuccess.php.
Could you help me?
You can also use the Date helper like this in your view :
<?php use_helper('Date'); ?>
<?php echo format_date($comment->getCreatedAt(), 'dd-MM-yyyy, HH:mm'); ?>
In your actions script you want to do something like:
$createdAt = strtotime($dbResults['created_at']);
$this->createdAt = date('H\hi m/d/Y', $createdAt);
Then just reference the available createdAt in your template:
<div>Created at: <?php echo $createdAt?></div>
More date formatting options can be found at the PHP date Api docs.