1
How I format that date 2016-10-23T20:30:01.017 in one Datatable.net in the Brazilian format dd/mm/yyyy ?
Controller:
This relevant snippet of the code is where I populate the object that is in the ok format: dd/mm/yyyyyy hh:mm:ss:
List<Cliente> lTotalClienteAux = _IRepositorio.ListarCliente().ToList();
List<Cliente> lTotalCliente = new List<Cliente>();
foreach (var item in lTotalClienteAux)
{
Cliente oCliente = new Cliente();
oCliente.ClienteID = item.ClienteID;
oCliente.DataCadastro = item.DataCadastro;
lTotalCliente.Add(oCliente);
}
View When you click here in the View the format changes to: 2016-10-24T20:35:13.617
{
"mRender": function (data, type, full) {
var dt = full['DataCadastro'];
return '<td>' + dt + '</td>';
}
},
web config. On the web.config I have this tag indicating the culture:
<system.web>
<globalization uiCulture="pt-BR" culture="pt-BR" enableClientBasedCulture="true" />
Your solution even works and shows the formatted date, but I’ve been searching and accurate
tipar
this column as type "Datetime` to sort.– hard123