function getQuarterByMonth(){
var today = new Date(); //获取当前时间
var month = today.getMonth() + 1;//getMonth返回0-11
//下面是几个if
if(month >=1 && month <=3){
return 1;
}else if(month >=4 && month <=6){
return 2;
}else if(month >=7 && month <=9){
return 3;
}else{
return 4;
}
}
¿Cómo obtener el trimestre actual, de acuerdo con el mes en curso con javascript
Supongo que te gusta
Origin blog.csdn.net/ShangMY97/article/details/103893214
Recomendado
Clasificación