该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
public static int getIntervalDays(String date1, String date2) {
return getIntervalDays(getTime(date1), getTime(date2));
}
public static int getIntervalDays(long s1, long s2) {
return (int) ( (s1 - s2) / (24 * 3600 * 1000L));
}
public static java.sql.Date str2date(String sDate) {
if (sDate == null || sDate.equals(""))
return null;
if (sDate.charAt(0) > '9' || sDate.charAt(0) < '0')
return null;
sDate = sDate.replace('/', '-');
String[] ar = strSplit(sDate, "- :");
if (ar.length < 3)
return null;
return java.sql.Date.valueOf(ar[0] + "-" + ar[1] + "-" + ar[2]);
}
public static long getTime(Object date) {
if (isEmpty(date))
return System.currentTimeMillis();
return str2date(date.toString()).getTime();
}
public static String getDateFromDate(String date, int avail) {
long lg = getTime(date);
return getDateString(lg + (long) avail * 86400000L);
}
public static String getDateString(long mill) {
java.sql.Date date = new java.sql.Date(mill);
return date.toString();
}