List of utility methods to do SQL Time From
java.sql.Time | toTime2(int value, int fraction, int width) to Time final long millis = getMillisFromTime2(value); return new java.sql.Time(millis + (nanosForFractionalValue(fraction, width) / 1000000)); |
java.sql.Time | toTime2(int value, int nanos) to Time final int h = (value >> 12) & 0x3FF; final int m = (value >> 6) & 0x3F; final int s = (value >> 0) & 0x3F; final Calendar c = Calendar.getInstance(); c.set(1970, 0, 1, h, m, s); c.set(Calendar.MILLISECOND, 0); final long millis = c.getTimeInMillis(); return new java.sql.Time(millis + (nanos / 1000000)); ... |
String | toTimeIso(Date date) Convert date into a string whose format is HH:mm:ss String val = ""; try { val = sdfTimeIso.get().format(date); } catch (Exception e) { val = sdfTimeIso.get().format(new Time(0)); return val; |