DataSet saves the field values which dataType is DATETIME as Date object of JavaScript. undefined, null or an empty string are saved as undefined. When transfer the values of DATETIME field through GridDataSet.setValue, you can transfer except Date object, undefined, null, ''. However, if the value cannot be directly recognized by JavaScript Date object, you should appropriately convert the format.
DataSet converts the value according to the conversion format set in DataField.datetimeFormat or DataSet.datetimeFormat. Please refer to datetimeFormat help topic about the details.
In the code below, it has set the conversion format as "yyyy/MM/dd HH:mm:ss".
dsMain = DataLudi.createGridDataSet();
dsMain.setFields(fields);
dsMain.setDatetimeFormat("yyyy/MM/dd HH:mm:ss");
DATETIME field value is displayed in the data cell according to the specified format in datetimeFormat of GridStyles. Please refer to GridStyles.datetimeFormat help topic about the details of display format.
In the example below, it displays the format in the column header.