eI am trying to show database time in the datatable but issue is show the current time
see database time
see datatable time

.cshtml
- $.ajax({
- url: strUrl,
- type: 'POST',
- success: function (result) {
- console.log("inside the success method")
- $('#').DataTable({
- data: result,
- columns: [
- { data: "StartFromTime" },
- { data: "EndToTime" },
- ],
- "aoColumnDefs": [
- {
- "aTargets": [0],
- //title: "StartFromTime",
- "mRender": function (row) {//data
- //console.log("inside the date and time:" + data + ":" + type);
- //console.log(moment(row.StartFromTime).format('DD/MM/YYYY hh:mm:ss'));
- //console.log("StartFromTime:" +moment(row.StartFromTime).format('hh:mm:ss'));
- //console.log("innnn");
- //console.log(row);
- ////console.log(data);
- //console.log(type);
- //console.log(moment(row).format('hh:mm:ss'));
- //var date = new Date(parseInt(data.substr(6)));
- //console.log("date:" + date);
- //return date.getDate();
- return moment(row.StartFromTime).format('hh:mm:ss');
- }
- },
- {
- "aTargets": [1],
- "mRender": function (row) {//data
- return moment(row.EndToTime).format('hh:mm:ss');
- }
- },
- public class TimeList
- {
- public int Id { get; set; }
- public DateTime StartFromTime { get; set; }
- public DateTime EndToTime { get; set; }
how to show the database time in datatable?
problem is moment() is built in jquery function that is the reason show the current time I want to show database time
I want to show database time in datatable?
Sachin SinghPosted Nov 28, 2020, 8:15 AM
Sachin SinghPosted Nov 28, 2020, 7:28 AM
-------Posted Nov 28, 2020, 7:19 AM
Sachin SinghPosted Nov 28, 2020, 7:15 AM
-------Posted Nov 28, 2020, 6:57 AM
Sachin SinghPosted Nov 28, 2020, 6:54 AM
-------Posted Nov 28, 2020, 6:37 AM
Sachin SinghPosted Nov 28, 2020, 6:29 AM
-------Posted Nov 28, 2020, 6:07 AM
Sachin SinghPosted Nov 28, 2020, 5:58 AM
-------Posted Nov 28, 2020, 5:55 AM
Sachin SinghPosted Nov 28, 2020, 5:45 AM