How do I format a Microsoft JSON date?

后端 未结 30 3088
伪装坚强ぢ
伪装坚强ぢ 2020-11-21 04:48

I\'m taking my first crack at Ajax with jQuery. I\'m getting my data onto my page, but I\'m having some trouble with the JSON data that is returned for Date data types. Basi

30条回答
  •  被撕碎了的回忆
    2020-11-21 05:00

    I also had to search for a solution to this problem and eventually I came across moment.js which is a nice library that can parse this date format and many more.

    var d = moment(yourdatestring)
    

    It saved some headache for me so I thought I'd share it with you. :)
    You can find some more info about it here: http://momentjs.com/

提交回复
热议问题