JSON date format seems different

This question already has an answer here:

  • The “right” JSON date format 10 answers

  • See the Stack Overflow question Format a Microsoft JSON date?:

    var date = new Date(parseInt(jsonDate.substr(6)));
    

    Stack Overflow question The "right" JSON date format is more specific and direct to your question.


    It's auto-conversion: 2013-01-09 02:18:11.117 = "/Date(1357690691117)/" (milliseconds)

    For example (conversion to "dd/mm/yyyy" format):

    function formatJsonDate(jsonDate) {
        return (new Date(parseInt(jsonDate.substr(6)))).format("dd/mm/yyyy");
    };
    
    var test = formatJsonDate('/Date(1357690691117)/');
    
    链接地址: http://www.djcxy.com/p/46656.html

    上一篇: 将字符串中的JSON日期替换为更具可读性的日期

    下一篇: JSON日期格式看起来不同