Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jqGridPHP:jqGridRender类>;setColProperty>&引用;“编辑选项”=&燃气轮机;数组(";value";=>;$datetime)>;如何格式化$datetime php变量?_Php_Jquery_Jqgrid_Jqgrid Php - Fatal编程技术网

jqGridPHP:jqGridRender类>;setColProperty>&引用;“编辑选项”=&燃气轮机;数组(";value";=>;$datetime)>;如何格式化$datetime php变量?

jqGridPHP:jqGridRender类>;setColProperty>&引用;“编辑选项”=&燃气轮机;数组(";value";=>;$datetime)>;如何格式化$datetime php变量?,php,jquery,jqgrid,jqgrid-php,Php,Jquery,Jqgrid,Jqgrid Php,在php文件中,我使用jqGridRender类来构建和管理网格 为了在我的SQL表中添加一个新项,我使用了一个名为$start的php变量。此变量是已知的,它属于我要添加的新项的主键。表中的类型为DATETIME,其值为“2010-06-16 06:00:00” 如何格式化下一行中的$start变量 $grid->setColProperty("start", array("hidden"=>true,"editoptions"=>array("value"=> $s

在php文件中,我使用jqGridRender类来构建和管理网格

为了在我的SQL表中添加一个新项,我使用了一个名为
$start
的php变量。此变量是已知的,它属于我要添加的新项的主键。表中的类型为DATETIME,其值为“2010-06-16 06:00:00”

  • 如何格式化下一行中的
    $start
    变量

    $grid->setColProperty("start", array("hidden"=>true,"editoptions"=>array("value"=> $start),"editrules"=>array("required"=>true)));
    
事实上,当我将其用作上述行时,
$start
等于表中的“2010-06-16 06:00:00”变为“2021-12-01 06:00:00”

请问怎么办


您好,奎利亚里斯,这是您的回复

我只需要添加以下行代码:

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