List of utility methods to do Day of
String | minusDate(int day, int type) return Minus day to date strings with user defined format. GregorianCalendar cal = new GregorianCalendar(); SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); cal.add(Calendar.DAY_OF_MONTH, -1); cal.add(type, -day); return formatter.format(cal.getTime()); |
Date | nextDay(Date date) next Day Date newDate = (Date) date.clone(); long time = newDate.getTime() / 1000L + 86400L; newDate.setTime(time * 1000L); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); try { newDate = format.parse(format.format(newDate)); } catch (Exception ex) { System.out.println(ex.getMessage()); ... |
String | nowDayString() now Day String return dayDateFormat.format(dateTimeConvert(0));
|
Date | parseBirthday(String r) parse Birthday SimpleDateFormat df = new SimpleDateFormat("y-M-d"); return df.parse(r); |
Calendar | parseCalendarDayFormat(String strDate) parse Calendar Day Format String pattern = "yyyy-MM-dd"; return parseCalendarFormat(strDate, pattern); |
String | parseDay(Date value, String defaultValue) Parses the day field from the given date. if (value == null) { return defaultValue; return new SimpleDateFormat("d").format(value); |
Date | parseDay(final String day) Parses the given day and returns the corresponding date. Date result = null; if (day != null && !day.isEmpty()) { try { final SimpleDateFormat dateTimeFormat = new SimpleDateFormat(DAY); dateTimeFormat.setTimeZone(TimeZone.getDefault()); result = dateTimeFormat.parse(day); } catch (final ParseException e) { return result; |
String | parseDay(int time) parse Day return yyyyMMdd.format(new java.util.Date(time * 1000L)); |
String | parseDay(String str, String type) parse Day if (type.equals("single")) { return "single"; if (type.equals("day")) { return str; SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMdd"); Date d = fmt.parse(str); ... |
String | parseDayTime(long ts) parse Day Time return dayFormat.format(new Date(ts)); |