根据时间戳及想要的时间格式装换出时间的js函数使用效果date("Y-m-d",1543920494) 2018-12-04 date("Y-m-d H:i:s",1543920494) 2018-12-04 18:48:14功能代码function date(format, timestamp) { var a, jsdate = ((timestamp) ? new Date(timestamp * 1000) : new Date()); var pad = function (n, c) { if ((n = n + "").length < c) { return new Array(++c - n.length).join("0") + n; } else { return n; } };

前端 2018-12-04