List of utility methods to do SQL Time Create
long | timeToLong(Object timeObj) time To Long long returnVal = 0; if (timeObj instanceof Timestamp) { returnVal = ((Timestamp) timeObj).getTime(); } else if (timeObj instanceof Date) { returnVal = ((Date) timeObj).getTime(); return returnVal; |
String | timeToString(java.sql.Time a_Time, String aS_Format) Converts java.sql.Timestamp to String with using specified format if (a_Time == null) return ""; SimpleDateFormat l_SimpleTimeFormat = new SimpleDateFormat(aS_Format); return l_SimpleTimeFormat.format(a_Time); |
String | timeToString(Time t) We will represent Times as hh/dd and trade them back and forth with sister routine stringToTime() String s = t.toString(); s = s.substring(0, 5); if (s.substring(0, 2).compareTo("12") > 0) { int ih = Integer.parseInt(s.substring(0, 2)) - 12; s = "" + ih + s.substring(2, 5); s = s + " pm"; } else { if (s.substring(0, 2).equals("12")) ... |
String | timeToString(Time time) Returns the time string of time value. DateFormat df = new SimpleDateFormat(TIME_FORMAT); return df.format(time); |