List of utility methods to do SQL Time Create
String | getTime() get Time Timestamp time = new Timestamp(Calendar.getInstance().getTime().getTime()); return time.toString(); |
String | getTime() get Time java.util.Date dt = new java.util.Date(); java.sql.Timestamp ts = new java.sql.Timestamp(dt.getTime()); String time = ts.toString(); return time.substring(0, 19); |
Time | getTime(final int hour, final int minute, final int second) Creates a java.sql.Time for a specified time in the UTC time zone. final Calendar cal = new GregorianCalendar(UTC); cal.clear(); cal.set(1979, 0, 1, hour, minute, second); return new Time(cal.getTimeInMillis()); |
String | getTime(GregorianCalendar cal) Gets time in hh:mm:ss format from GregorianCalendar. SimpleDateFormat sdf = new SimpleDateFormat(timeFormat); Date date = cal.getTime(); return sdf.format(date); |
Time | getTime(java.util.Date date) get Time if (date == null) { return currentTime(); Calendar c = Calendar.getInstance(); c.setTimeInMillis(date.getTime()); c.set(Calendar.YEAR, 1970); c.set(Calendar.MONTH, Calendar.JANUARY); c.set(Calendar.DAY_OF_MONTH, 1); ... |
String | getTime(long time) Creates a timestamp using the Timestamp class. String stamp = new Timestamp(time).toString(); return stamp.substring(0, stamp.length() - 4); |
Timestamp | getTime(long time) get Time if (time == 0 || time < 0) { return getCurrentTimestamp(); return new Timestamp(time); |
String | getTime(long time) get Time SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); return format.format(new Date(time)); |
String | getTime(long time, boolean allowNull) Gets the database format for a time field. return allowNull && time == -1 ? null : new Timestamp(time).toString().substring(11, 19); |
java.sql.Time | getTime(Map map, String attr) get Time return (java.sql.Time) map.get(attr);
|