List of utility methods to do SQL Date Create
Date | getCurrDate() get Curr Date DateFormat formatter = new SimpleDateFormat("yyyyMMddhhmmssSSS"); long now = System.currentTimeMillis(); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(now); return calendar.getTime(); |
String | getCurrentDate() Get current date, format yyyy/MM/dd. return formatDate(getCurrentTimestamp());
|
String | getCurrentDate() get Current Date Date date = new Date(System.currentTimeMillis()); return DATE_FORMAT.format(date); |
String | getCurrentDate() Get current date's string return new SimpleDateFormat(DATE_FORMAT_yyyy_MM_dd).format(new Date(System.currentTimeMillis())); |
Date | getCurrentDate() get Current Date Calendar c = new GregorianCalendar(); return new Date(c.getTimeInMillis()); |
Date | getCurrentDate() get Current Date java.util.Date utilDate = new java.util.Date(); return new java.sql.Date(utilDate.getTime()); |
java.sql.Date | getCurrentDate() get Current Date return new java.sql.Date(new Date().getTime()); |
Timestamp | getCurrentDate() get Current Date Calendar c = Calendar.getInstance(); c.set(c.get(1), c.get(2), c.get(5), 0, 0, 0); Timestamp t = new Timestamp(c.getTime().getTime()); t.setNanos(0); return t; |
Date | getCurrentDateStart() get Current Date Start Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
return calendar.getTime();
|
String | getCurrentDateStr(String strFormat) Return the current date in the specified format Calendar cal = Calendar.getInstance();
Date currDate = cal.getTime();
return format(currDate, strFormat);
|