Java Utililty Methods SQL Time Create

List of utility methods to do SQL Time Create

Description

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

Method

longtimeToLong(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;
StringtimeToString(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);
StringtimeToString(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"))
...
StringtimeToString(Time time)
Returns the time string of time value.
DateFormat df = new SimpleDateFormat(TIME_FORMAT);
return df.format(time);