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

前端 未结 10 1909
甜味超标
甜味超标 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:39

    I've found that this is a useful technique for dealing with this problem:

    http://icanmakethiswork.blogspot.co.uk/2012/04/beg-steal-or-borrow-decent-javascript.html

    It allows DateTimes to be serialised as ISO 8601 date strings which can be used with the JavaScript Date constructor and has the bonus of being human readable.

提交回复
热议问题