如何使用日期函数在javascript中制作这样的格式:
Jun 23, 2010 12:00 AM
答案 0 :(得分:0)
var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
var date = new Date();
console.log(months[date.getMonth()] + " " + date.getDate() + ", " + (date.getYear()+1900) + " " + date.getHours() + ":" + date.getMinutes());
//Example Output: Apr 28, 2013 20:47