|  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 两个日期相差天数 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static long daysBetweenyyyy_MM_dd(Date yyyy_MM_dd_1 , Date yyyy_MM_dd_2)throws Exception{ | 
|---|
|  |  |  | return ((((yyyy_MM_dd_1.getTime() - yyyy_MM_dd_2.getTime())/1000)/60)/60)/24 ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 两个日期相差天数 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static long daysBetweenyyyyMMdd(String yyyyMMdd_1 , String yyyyMMdd_2)throws Exception{ | 
|---|
|  |  |  | return ((((dateFrom_yyyy_MM_dd(yyyyMMdd_1).getTime()-dateFrom_yyyy_MM_dd(yyyyMMdd_2).getTime())/1000)/60)/60)/24 ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | ////////////////////////////////////////////////////////////////////////// | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 字符串型日期(2024-12)转成年月日数组 | 
|---|
|  |  |  | * @param yyyy_MM 年月日 | 
|---|
|  |  |  | * @return 年月日数组 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static int[] yyyy_MM_ymdGroup(String yyyy_MM){ | 
|---|
|  |  |  | int y = Integer.parseInt(yyyy_MM.substring(0 , 4)) ; | 
|---|
|  |  |  | int m = Integer.parseInt(yyyy_MM.substring(5 , 7)) ; | 
|---|
|  |  |  | return new int[]{y,m} ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 字符串型日期(2009-09-10)转成年月日数组 | 
|---|
|  |  |  | * @param yyyy_MM_DD 年月日 | 
|---|
|  |  |  | * @return 年月日数组 | 
|---|