⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

To change the integer time to a timestamp when state=Read



Rajeshwar

Rajeshwar
  • profile picture
  • Member

Posted 21 January 2016 - 10:29 AM

While using Grocery CRUD,

I have a database field "created"(dataType=>integer).

 

When state=list the following code converts the integer to date format and display,

 

$crud->callback_column('created', array($this,'date_display')); //where date_display a function to change date format works

 

 

function date_display($value, $row){
   return  date('d M Y H:i:s',$value);
}

 

 

 

Whereas when state="read" the above code does not work and neither the function "change_field_type" works.

 

$crud->change_field_type('created', 'datetime');

 

How to change the integer time to date format in case of state='read'?