-4

Date 関数を使用して、javascript でこのような形式を作成する方法:

Jun 23, 2010 12:00 AM
4

1 に答える 1

0

http://jsfiddle.net/tqwEE/

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
于 2013-04-29T03:46:26.517 に答える