Date toLocaleFormat 参数说明
Date toLocaleFormat 参数说明
var today= new Date();
alert(today.toDateString());
alert(today.toLocaleString());
alert(today.toLocaleDateString());
alert(today.toLocaleFormat("%m/%d/%Y"));
Date toLocaleFormat 参数:%m/%d/%Y
alert(today.toDateString());
alert(today.toLocaleString());
alert(today.toLocaleDateString());
alert(today.toLocaleFormat("%m/%d/%Y"));
Date toLocaleFormat 参数:%m/%d/%Y
示例
alert(new Date().toLoacleFormat('%Y-%m-%d'));