var today = new Date();
today_year = today.getFullYear(); //getYear()的定義原本就是年份減去1900,要改用這個today_month = today.getMonth()+1; //月是從0開始
today_date = today.getDate();
today_day = today.getDay(); //它是星期
alert(today_year+'年'+today_month+'月'+today_date+'日'+'星期'+today_day);
javascript沒有format寫法(new Date("yyyy-MM-dd HH:mm"))
4564
沒有留言:
張貼留言