Java Utililty Methods SQL Date From

List of utility methods to do SQL Date From

Description

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

Method

TimestampgetCurrentTime()
get Current Time
Calendar calendar = Calendar.getInstance();
java.util.Date now = calendar.getTime();
Timestamp currentTimestamp = new Timestamp(now.getTime());
return currentTimestamp;
TimestampgetCurrentTime()
get Current Time
long time = Calendar.getInstance(Locale.CANADA).getTime().getTime();
return new Timestamp(time);
StringgetCurrentTime()
get Current Time
return getDateString(DATETIME_FORMAT);
StringgetCurrentTime(String format)
get Current Time
Calendar calendar = Calendar.getInstance();
SimpleDateFormat formats = new SimpleDateFormat(format);
String time = formats.format(calendar.getTime());
return time;
longgetCurrentTimeMillis()
get Current Time Millis
Timestamp time = getSysDate();
return time.getTime();
StringGetCurrFormattedDateTime(String strFormatTo)
Get Curr Formatted Date Time
java.sql.Timestamp date = new java.sql.Timestamp(System.currentTimeMillis());
SimpleDateFormat formatter = new SimpleDateFormat(strFormatTo);
return formatter.format(date);
StringgetCurrTime()
get Curr Time
Date currdate = getTodayDate();
java.sql.Time tt = new java.sql.Time(currdate.getTime());
return tt.toString();
TimestampgetCurTime()
get current time
return new Timestamp(Calendar.getInstance().getTime().getTime());
LocalTimegetDatabaseLocalTime(Time databaseDate)
get Database Local Time
if (databaseDate != null) {
    return databaseDate.toLocalTime();
} else {
    return null;
TimestampgetDateTime()
get Date Time
return Timestamp.valueOf(getFormatDate("yyyy-MM-dd HH:mm:ss"));