/** * @param date 日期(八位字符串) * @return */ public static String getDay(String date) { if (!ValidHelper.isValidDate(date)) return null; String day = date.substring(6, 8); if (day.startsWith("0")) day = day.substring(1); return day; }
/** @return 日期月份 */ public static String getMonth(String date) { if (!ValidHelper.isValidDate(date)) return null; String month = date.substring(4, 6); if (month.startsWith("0")) month = month.substring(1); return month; }