Hi Abu,
When I Use
$col["formatter"] = "datetime";
$col["formatoptions"] = array("srcformat"=>'H:i:s',"newformat"=>'H:i:s',"opts" => array("timeOnly" => true));
I'm getting the result Date and Time ('2016-07-26 00:00:00') but i need only Time ('00:00:00').
Thank you.
Try following:
$col["formatter"] = "datetime";
# opts array can have these options: http://trentrichardson.com/examples/timepicker/#tp-options
$col["formatoptions"] = array("srcformat"=>'Y-m-d H:i:s',"newformat"=>'h:i:s A',"opts" => array("timeOnly" => true, "timeFormat"=>"hh:mm:ss tt"));
Hi Abu,
I tried this. Its working on TIMESTAMP data type. But In my table i have used the datatype TIME so I need TIME value only in INSERT QUERY but its return TIMESTAMP value in INSERT QUERY.
Actual PHPGRID INSERT Query:
INSERT INTO ADMIN."timecheck" ("starttime", "endtime") values ('2016-07-26 05:00:00', '2016-07-26 13:00:00')
Need Like This:
INSERT INTO ADMIN."timecheck" ("starttime", "endtime") values ('05:00:00', '13:00:00')
HERE starttime & endtime DB2 Datatype is TIME.
Simple solution without any major change is to connect on_update event handler and split the data part from the field. e.g if posted date column name is 'invdate' then …
$e["on_update"] = array("update_client", null, true);
$g->set_events($e);
function update_client($data)
{
$x = explode(" ",$data["params"]["invdate"]);
$data["params"]["invdate"] = $x[1];
}