optimize codes
This commit is contained in:
@@ -287,4 +287,21 @@ public class DateTimeUtil {
|
||||
}
|
||||
return returnDate;
|
||||
}
|
||||
|
||||
public static String getDateByFormatPlusOneDay(Date dtDateTime, String strFormat) {
|
||||
|
||||
if (dtDateTime == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(dtDateTime);
|
||||
calendar.add(Calendar.DAY_OF_MONTH, 1);
|
||||
|
||||
return new SimpleDateFormat(strFormat).format(calendar.getTime());
|
||||
} catch (Exception err) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user