说明
方法将日期转换为使用指定格式的字符串。
注意-此方法可能不兼容所有浏览器。
应该使用toLocaleString
参数明细
formatString−C中strftime()函数所期望的格式字符串。
返回值
返回格式化日期。
示例
var dt = new Date(2010, 6, 28, 14, 39, 7); console.log( "格式化后的日期: " + dt.toLocaleFormat( "%A, %B %e, %Y" ) );
语法
Date.toLocaleFormat()
日期:2019-08-20 13:50:53 来源:oir作者:oir