How do you pass a date time (i need it to the second) to c# using jquery and mvc3. This is what I have
var date = new Date();
$.ajax(
{
type: "POST",
url: "/Group/Refresh",
contentType: "application/json; charset=utf-8",
data: "{ 'MyDate': " + date.toUTCString() + " }",
success: function (result) {
//do something
},
error: function (req, status, error) {
//error
}
});
I can't figure out what format the date should be in, for C# to understand it.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…