Javascript serialization of DateTime in asp.net is not giving a javascript date object?

前端 未结 10 1923
甜味超标
甜味超标 2020-12-01 06:04

When I parse a DateTime to json in .Net it returns a string (i.e. \"\\/Date(1249335194272)\\/\"). How do I make it return a js Date object constructor not wrap

10条回答
  •  自闭症患者
    2020-12-01 06:58

    jsonDateNow = String.Format("Date({0},{1},{2})", Date().Now.getYear(), Date().Now.getMonth() -1, Date().Now.getDay());
    

提交回复
热议问题