Java Utililty Methods SQL Time From

List of utility methods to do SQL Time From

Description

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

Method

StringgetDateTimeStringFromCalendar(Calendar calendar)
get Date Time String From Calendar
String dateString = nameOfDay[calendar.get(Calendar.DAY_OF_WEEK)] + " ";
dateString += getDateAsString(calendar.get(Calendar.MONTH) + 1, calendar.get(Calendar.DATE),
        calendar.get(Calendar.YEAR));
dateString += (" " + calendar.get(Calendar.HOUR_OF_DAY) + ":" + calendar.get(Calendar.MINUTE) + ":"
        + calendar.get(calendar.SECOND) + " " + ZONE);
return dateString;
StringgetDateTimeTypeString(Connection conn)
get Date Time Type String
if (isOracleServer(conn))
    return "DATE";
return "DATETIME";
StringgetDateTimeTypeString(Connection conn)
get Date Time Type String
if (isOracleServer(conn))
    return "DATE";
return "DATETIME";
DateTimetoDateTime(final java.util.Date d)
to Date Time
final DateTime dt = (d == null ? null : new DateTime(d));
return dt;
java.sql.TimestamptoDatetime(long value)
to Datetime
final int sec = (int) (value % 100);
value /= 100;
final int min = (int) (value % 100);
value /= 100;
final int hour = (int) (value % 100);
value /= 100;
final int day = (int) (value % 100);
value /= 100;
...
StringtoDateTimeString(java.util.Date inDate)
Description of the Method
try {
    return java.text.DateFormat.getDateTimeInstance(java.text.DateFormat.SHORT, java.text.DateFormat.LONG)
            .format(inDate);
} catch (NullPointerException e) {
return "";
java.sql.TimetoSQLTime(final LocalTime lt)
to SQL Time
final java.sql.Time t = (lt == null ? null : new java.sql.Time(lt.getMillisOfDay()));
return t;
java.sql.TimetoSqlTime(long date)
to Sql Time
return new java.sql.Time(date);
TimetoTime(Date value)
to Time
if (value instanceof Time) {
    return (Time) value;
final Calendar cal = Calendar.getInstance();
cal.setTime((Date) value);
return new java.sql.Time(cal.getTimeInMillis());
TimetoTime(final Date date)
to Time
return new Time(date.getTime());