List of utility methods to do Now
String | calNow() cal Now return calFormat(Calendar.getInstance());
|
int | compareDateWithNow(Date date1) compare Date With Now Date date2 = new Date(); int rnum = date1.compareTo(date2); return rnum; |
int | compareWithNow_2(String t) compare With No_ SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT_2); Calendar c1 = Calendar.getInstance(); Calendar c2 = Calendar.getInstance(); try { c1.setTime(formatter.parse(t)); c2.setTime(new Date()); } catch (ParseException e) { e.printStackTrace(); ... |
String | formatNow() format Now return formatDateISO(new Date()); |
String | formatNow() format Now return formatDateISO(new Date()); |
String | formatNow() Formats a Date into a date/time string. SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd-HH:mm:ss"); return format.format(new Date()); |
String | formatNow(String fmt) format Now return formatDate(new Date(), fmt); |
String | formatNow(String pattern) format Now return new SimpleDateFormat(pattern).format(new Date()); |
String | formatNow(String style) format Now return new SimpleDateFormat(style).format(System.currentTimeMillis()); |
String | formatTime(Date now, String pattern) format Time SimpleDateFormat sdf = new SimpleDateFormat(pattern); return sdf.format(now); |