javascript date from controller

This question already has an answer here:

  • How do I format a Microsoft JSON date? 37 answers

  • function getDate(str){        
        // extract number from string using regex
        var stringNum = str.match(/d+/)[0];
    
        // turn number into int
        var intNum = stringNum * 1;
    
        // turn int into date
       return new Date(intNum);
    
    var str = '/Date(1451599200000)/';
    alert(getDate(str));
    
    链接地址: http://www.djcxy.com/p/8168.html

    上一篇: 在Javascript中使用来自Restful Service的日期格式

    下一篇: 来自控制器的javascript日期