views:

44

answers:

1

Hello,

In a php file, i use the jqGridRender Class to build and manage a grid.

To add a new item in my SQL table, i use (among others things) a php variable named $start. This variable is known, it belong to the PRIMARY KEY of this new item i want to add. Its type in the table is DATETIME and its value is "2010-06-16 06:00:00"

  • How to format $start variable in the followsing line ?

    $grid->setColProperty("start", array("hidden"=>true,"editoptions"=>array("value"=> $start),"editrules"=>array("required"=>true)));
    

In fact, when i use it as the above line,$startequals "2010-06-16 06:00:00" becomes "2021-12-01 06:00:00" in the table.

What to do, please ?

Regards, Qualliarys

+1  A: 

Here is the response !

I just need to add this following line code :

 // Set a new user datetime format using PHP convensions
 $grid->setUserTime('Y-m-d H:i:s');
Qualliarys