Java Utililty Methods SQL Date Create

List of utility methods to do SQL Date Create

Description

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

Method

TimestampgetSysDate()
get Sys Date
return new Timestamp(System.currentTimeMillis());
StringgetSysdate(String format)
get Sysdate
String selectTocharSysdate = "select to_char(sysdate,'dd/mm/yyyy hh24:mi:ss') from dual";
long time = System.currentTimeMillis();
java.sql.Date date = new java.sql.Date(time);
return convertDateToString(date, format);
DategetSysDateGMTToday()
get Sys Date GMT Today
long time = getSystemTimeGMTToday();
if (time == -1) {
    return null;
return new Date(getSystemTimeGMTToday());
DategetTodayDate()
get Today Date
long date = System.currentTimeMillis();
java.sql.Date result = new java.sql.Date(date);
return result;
StringgetTodayDate()
get Today Date
java.util.Date date = new java.util.Date();
java.util.Date today = new java.sql.Timestamp(date.getTime());
String todayDate = String.valueOf(today);
return todayDate.substring(0, 10) + "-" + todayDate.substring(11, 22);
java.sql.DategetTodaySqlDate()
get Today Sql Date
return new java.sql.Date(getToday().getTime());
java.sql.DategetTodaySqlDate()
get Today Sql Date
return new java.sql.Date(getToday().getTime());