Pass a datetime from javascript to c# (Controller)

前端 未结 7 2230
小蘑菇
小蘑菇 2020-12-08 02:01

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: \         


        
7条回答
  •  孤街浪徒
    2020-12-08 02:24

    Update: Please see marked answer as a better solution to implement this. The following solution is no longer required.

    Converting the json date to this format "mm/dd/yyyy HH:MM:ss"
    dateFormat is a jasondate format.js file found at blog.stevenlevithan.com

    var _meetStartTime = dateFormat(now, "mm/dd/yyyy HH:MM:ss");
    

提交回复
热议问题