Yii Framework Forum: DetailView: minutes instead of month shown (datetime) - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

DetailView: minutes instead of month shown (datetime)

#1 User is offline   Neodym 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 03-July 17

Posted 15 July 2018 - 06:17 AM

Hello!

In on of my tables I have a column last_modified created as DATETIME. So one entry there e.g. is 2014-10-15 07:36:03.

Now I try to format the output, but is does not work as I would like to have it.

<?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            ...
            'last_modified',
            [
                'attribute' => 'last_modified',
                'format' => ['datetime', 'Y-m-d'],
            ],            
            ...
        ],
    ]) ?>


The first output is 2014-10-15 07:36:03 as expected.
The second output is 2014-36-15 but I was expecting 2014-10-15.

I get the same output with
'format' => ['date', 'Y-m-d'],
.

For me it looks like there was shown year-minute-day but I would like to have the month instead. What do I not see here and how can I get my desired output?

Thanks in advance!

Best regards,
Heiko
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users