预处理时间调整

This commit is contained in:
2023-04-23 10:37:41 +08:00
parent e4c8611f03
commit 707b3a2e0e

View File

@@ -91,8 +91,12 @@ public class PublicUtil {
public static void main(String[] args) { public static void main(String[] args) {
// Integer temp =Integer.valueOf ("2002-08-07".substring (5, 7)) ; // Integer temp =Integer.valueOf ("2002-08-07".substring (5, 7)) ;
System.out.println (111 ); // System.out.println (111 );
System.out.println ( PublicUtil.getNowQuarter ("2002-01-07")); // System.out.println ( PublicUtil.getNowQuarter ("2002-01-07"));
System.out.println(getDayByMonth(2023,03));
} }
/** /**
@@ -122,9 +126,24 @@ public class PublicUtil {
date = year +"-"+month+"-"+i; date = year +"-"+month+"-"+i;
} }
list.add(date); list.add(date);
if (Objects.equals(date,getYesterday())){
break;
}
} }
return list; return list;
} }
/**
* 获取昨天日期
*/
public static String getYesterday() {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE,-1);
Date d=cal.getTime();
SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-dd");
return sp.format(d);
}
/** /**
* @Description: 根据电压字典获取电压等级 * @Description: 根据电压字典获取电压等级
* @Param: [id, dictDataList] * @Param: [id, dictDataList]