一个JS的日期格式化算法示例

gejie36291 9 0 PDF 2020-12-13 10:12:44

代码如下: function dateFormat(date, format) { var o = { “M+”: date.getMonth() + 1, //month “d+”: date.getDate(), //day “h+”: date.getHours(), //hour “m+”: date.getMinutes(), //minute “s+”: date.getSeconds(), //second “q+”: Math.floor((date.getMonth() + 3) / 3), //quarter “S”: date.getMilliseconds() //mi

用户评论
请输入评论内容
评分:
暂无评论