**display both date and time for sending and receiving messages**
在下面的代码中,它仅显示时间,我想同时显示日期和时间
console.log("finaltime",finaltime);
if(finalTimeA[0]>12){
finaltime="0"+(finalTimeA[0]-12)+":"+finalTimeA[1]+"PM";
console.log("finalTimeA[0]<12",finaltime);
}
else if(finalTimeA[0]==12){
finaltime=finalTimeA[0]+":"+finalTimeA[1]+"PM";
console.log("finalTimeA[0]==12",finaltime);
}
else if(finalTimeA[0]<12){
finaltime=finalTimeA[0]+":"+finalTimeA[1]+"AM";
console.log("finalTimeA[0]>12",finaltime);
}
else if(finalTimeA[0]==24){
finaltime=(finalTimeA[0]-12)+":"+finalTimeA[1]+"AM";
console.log("finalTimeA[0]==24",finaltime);
}
i["finaltime"]=finaltime;
}