如何将timeInMs转换为此格式dd / mm / yyyy
var timeInMs = Date.now();
alert(timeInMs);
//convert to dd/mm/yyy
在处理时间/日期时使用jquery有什么好处吗?
答案 0 :(得分:0)
var date = new Date();
var year = date.getUTCFullYear();
var month = date.getUTCMonth();
var day = date.getUTCDate();
//month 2 digits
month = ("0" + (month + 1)).slice(-2);
//year 2 digits
year = year.toString().substr(2,2);
var formattedDate = day + '/' + month + "/" + year;
打印25/10/13