Why Join
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
MonthlyLeaders
ASK A QUESTION
Forumguidelines
-------
1.8k
212
2.6k
datatable time is different from database time
Nov 28 2020 4:57 AM
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'
);
}
},
model
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?
Reply
Answers (
12
)
DataList - Hyperlink - NavigateURL Property - IMP
Asp.net mvc core multiple Navbar radio button