给定数组形式的日期,获取年月日.年月日为什么获取不到
tDate['2023-05-05','2023-05-12']
for(var j = 0; j < tDate.length; j++){
console.log("rtDate:"+tDate[j])
console.log("tDate:"+new Date(tDate[j]))
var arri ="";
arri= tDate[j];
//获取调休日期的年月日
var tyear = new Date(arri).getFullYear;
var tmonth = new Date(arri).getMonth+1;
var tday = new Date(arri).getDate;
console.log("年月日:"+tyear+"-"+tmonth+"-"+tday)
if(my_year==tyear&&month1==tmonth&&tday==i){
t = true;
z = false;
}
控制台输出结果
rtDate:2023-05-12
tDate:Fri May 12 2023 08:00:00 GMT+0800 (中国标准时间)
年月日:function getFullYear() { [native code] }-function getMonth() { [native code] }1-function getDate() { [native code] }