datepicker中的日期UTC

时间:2013-03-20 06:15:07

标签: jquery date datepicker

显示小日期的问题。目前,它显示了长时间的UTC日期。

var events = [ 
    { Title: "Five K for charity", Date: new Date("03/13/2013"), Time: "11:15" }, 
    { Title: "Dinner", Date: new Date("03/25/2013"), Time: "11:15" }, 
    { Title: "Meeting with manager", Date: new Date("03/01/2013"), Time: "11:15" }
];


        for(var d=0;d<events.length;d++) {
        $('.myarray').append('<div><span>'+events[d].Title + '</span><br>' + events[d].Date + '<br>' + events[d].Time + '<br><br></div>');
        }

1 个答案:

答案 0 :(得分:0)

您的event[]数组应该是这样的:

var events = [{
   Title: "Five K for charity",
   Date: "03/13/2013",
   Time: "11:15"
}, {
   Title: "Dinner",
   Date: "03/25/2013",
   Time: "11:15"
}, {
   Title: "Meeting with manager",
   Date: "03/01/2013",
   Time: "11:15"
}];

Date: new Date("03/25/2013"),这会创建标准的完整日期和时间。