Java Utililty Methods SQL Date Get

List of utility methods to do SQL Date Get

Description

The list of methods to do SQL Date Get are organized into topic(s).

Method

StringgetDate()
get Date
return new Timestamp(System.currentTimeMillis()).toString().substring(0, 10);
StringgetDate()
RETURN DATE
Timestamp ts = null;
try {
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    String d = sdf.format(new java.util.Date());
    ts = Timestamp.valueOf(d);
} catch (Exception ex) {
    ex.printStackTrace();
return ts.toString().substring(8, 10);
StringgetDate()
get Date
Timestamp ts = getCurrentTimestamp();
SimpleDateFormat format = new SimpleDateFormat("MM/dd/yy");
return format.format(ts);
DategetDate()
get Date
return java.sql.Date.valueOf(getFormatDate("yyyy-MM-dd"));
DategetDate()
get Date
return new Date();
DategetDate()
get Date
return currentDate();
DategetDate()
Buat object java.sql.Date dari hari ini.
LocalDate localDate = getNowLocalDate();
return toDate(localDate);
DategetDate(Calendar pCal)

Get Date from Calendar.

java.util.Date date = pCal.getTime();
return new java.sql.Date(date.getTime());
java.sql.DategetDate(Date date)
get Date
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return new java.sql.Date(cal.getTimeInMillis());
longgetDate(Date value)
Gets the date.
return value == null ? -1 : value.getTime();