[javascript] 取得目前的時間 ( 年、月、時、分 ) 的程式碼片段

var today=new Date();

var currentDateTime =

today.getFullYear()+'年'+

(today.getMonth()+1)+'月'+

today.getDate()+'日('+

today.getHours()+':'+today.getMinutes()+

')';

console.info(currentDateTime);

arrow
arrow

    Johnson峰 發表在 痞客邦 留言(0) 人氣()