首頁  >  文章  >  web前端  >  json 日期資料轉成日期字串

json 日期資料轉成日期字串

巴扎黑
巴扎黑原創
2016-11-25 14:12:591215瀏覽

   function ChangeDateFormat(jsondate) {  

            jsondate = jsondate.replace("/Date(", "").replace(")/", "");  

              

            if (jsondate.indexOf("+") > 0) { 🠎 , jsondate.indexOf("+"));  

            } else if (jsondate.indexOf("-") > 0) {

             

           .  

            }  

            //alert(jsondate);  

            var date = new Date(parseInt(jsondate, 10));  

            //alert(date.getHours());  

            var Month = date.getMonth() + 1             var currentDate = date.getDate()


            return date.getFullYear() + "-" + 月份 + "-" + currentDate ;

🜎
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn