Yii Framework Forum: date and time format in gridview from oracle HELP - Yii Framework Forum

Jump to content

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

date and time format in gridview from oracle HELP how to show time format from oracle in a gridview Rate Topic: -----

#1 User is offline   Raciel 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 04-July 17

Posted 04 July 2017 - 04:35 PM

Hi:
I´m usign Yii2 with oracle db, and in the table, I have a field type DATE that contains the date and time of the INSERT RECORD.

The problem is, when I try to show it in the gridview or detailview widget...
I tried to doit with the use of 'yii\i18n\Formatter' in the main configuration, like this
'formatter' => [
    'class' => 'yii\i18n\Formatter',
    'dateFormat' => 'php:d/m/Y',
    'datetimeFormat' => 'php:d/m/Y H:i:s',
    'timeFormat' => 'php:H:i:s',
    'nullDisplay' => '-',
],


and in the index view like this
 <?= GridView::widget([
      (...)
      columns => [
         'dateField:datetime',
         (...)
       ],
 ])?>

but all I get in the view is "25/06/2017 00:00:00", I DON'T KNOW WHY ???
when i do the "select to_char(dateField, 'DD/MM/YYYY HH24:MI:SS') from temp" i get '25/06/2017 22:50:20' and this is what i need to get.

how can i do it rigth.
i need some help
thanks.
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