function getDateStr(date, DATEorTIME) {
// javascript:getDateStr(date,"DATEorTIME");
var y = date.getFullYear();
var m = date.getMonth() + 1;
m = m < 10 ? ('0' + m) : m;
var d = date.getDate();
d = d < 10 ? (
JS根据日期返回日期格式字符串代码
![](https://img-home.csdnimg.cn/images/20240711042549.png)