List of utility methods to do Day
String | dateValue(Date d) date Value return sdf.format(d);
|
long | day2Day(String startDate, String endDate, String format) day Day if (format == null) format = "yyyy/MM/dd HH:mm:ss.SSS"; SimpleDateFormat sdf = new SimpleDateFormat(format); Date sDate; Date eDate; long day2day = 0; try { sDate = sdf.parse(startDate); ... |
String | day2ThuesDay(Date date) day Thues Day Calendar calendar = Calendar.getInstance(); calendar.setTimeZone(TimeZone.getTimeZone("Asia/Tokyo")); calendar.setTime(date); int week = calendar.get(Calendar.DAY_OF_WEEK); if (week == Calendar.MONDAY || week == Calendar.SUNDAY) { week += 7; calendar.add(Calendar.DAY_OF_MONTH, -week); ... |
long | dayDiff(Date date1, String date2) day Diff SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); long diff = 0l; try { long d1 = date1.getTime(); long d2 = sdf.parse(date2).getTime(); diff = (Math.abs(d1 - d2) / (1000 * 60)); } catch (ParseException e) { e.printStackTrace(); ... |
Date | dayEnd(Date date) day End if (date == null) return null; DateFormat dayGranularity = new SimpleDateFormat("ddMMyyyy"); DateFormat secondGranularity = new SimpleDateFormat("ddMMyyyy:HHmmss"); String today = dayGranularity.format(date); try { return secondGranularity.parse(today + ":235959"); } catch (ParseException e) { ... |
Date | dayFillter(String text, String type) day Fillter SimpleDateFormat format = new SimpleDateFormat(type); try { return format.parse(text); } catch (ParseException e) { e.printStackTrace(); return getTimezoneDate(_DEFAULT_TIMEZON); |
Date | dayFillter(String text, String type) day Fillter SimpleDateFormat format = new SimpleDateFormat(type); try { return format.parse(text); } catch (ParseException e) { e.printStackTrace(); return new Date(); |
Date | dayFilter(Date date) day Filter SimpleDateFormat format = new SimpleDateFormat(_8DIGIT_DATE_1); return dayFilter(format.format(date)); |
int | dayForAMorPM(String date) day For A Mor PM SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); Date dateparam = null; try { dateparam = format.parse(date); } catch (ParseException e) { e.printStackTrace(); Calendar calendar = Calendar.getInstance(); ... |
String | dayFormat(Date date) day Format return new SimpleDateFormat("yyyyMMdd").format(date); |