List of utility methods to do Day of
String | getBirthday(String age) get Birthday Calendar c = Calendar.getInstance(); c.add(Calendar.YEAR, -Integer.parseInt(age)); SimpleDateFormat format = new SimpleDateFormat(defaultDatePattern); return format.format(c.getTime()); |
Date | getBirthDay(String idCard) get Birth Day String birthDay; if (idCard.length() == 15) { birthDay = "19" + idCard.substring(6, 12); } else { birthDay = idCard.substring(6, 14); SimpleDateFormat dateFormat = new SimpleDateFormat(DateFormatPattern, Locale.ENGLISH); return dateFormat.parse(birthDay); ... |
DateFormat | getBirthDayDateFormat() get Birth Day Date Format return getFormat("MM-dd"); |
String | getBirthdayFormatStr(Date date) get Birthday Format Str SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); return sdf.format(date); |
String | getBookInfoDate(int days) get Book Info Date Date now = new Date(); return yyyyMmDd.format(new Date(now.getTime() - (long) days * 24 * 60 * 60 * 1000)); |
Calendar | getCalendarByDay(String dayStr) get Calendar By Day Calendar calendar = Calendar.getInstance();
Date date = yyyyMMddFormat.parse(dayStr);
calendar.setTime(date);
return calendar;
|
long | getConfirmDateTimeOfDay(Date currentDate) get Confirm Date Time Of Day try { SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); return sf.parse(sf.format(currentDate)).getTime() / 1000; } catch (Exception e) { e.printStackTrace(); return -1; |
String | getCurDayZero() get Cur Day Zero Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); return new SimpleDateFormat("yyyy-MM-dd 00:00:00").format(calendar.getTime()); |
File | getDataFile(int tableId, Date day) get Data File String dateText = getDayText(day); File tableDir = new File(logDir, Integer.toString(tableId)); File datafile = new File(tableDir, dateText + ".dat"); return datafile; |
Date | getDataTimeForwordDay(Date date, int dayNum) get Data Time Forword Day Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, dayNum);
return cal.getTime();
|