@Test public void testCreateTime() { Timestamp t = Timestamp.valueOf("2004-06-30 23:39:10.1201"); Time date = TimestampWithTimezone.createTime(t); Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(date.getTime()); assertEquals(cal.get(Calendar.HOUR_OF_DAY), 23); assertEquals(cal.get(Calendar.MINUTE), 39); assertEquals(cal.get(Calendar.SECOND), 10); assertEquals(cal.get(Calendar.MILLISECOND), 0); assertEquals(cal.get(Calendar.YEAR), 1970); assertEquals(cal.get(Calendar.MONTH), Calendar.JANUARY); assertEquals(cal.get(Calendar.DATE), 1); }
public static Time createTime(java.util.Date date, TimeZone initial, Calendar target) { if (target == null) { target = getCalendar(); } long time = target.getTimeInMillis(); adjustCalendar(date, initial, target); Time result = normalizeTime(date, target); target.setTimeInMillis(time); return result; }
TimestampWithTimezone { public static Time createTime(java.util.Date date, TimeZone initial, Calendar target) { if (target == null) { target = getCalendar(); } long time = target.getTimeInMillis(); adjustCalendar(date, initial, target); Time result = normalizeTime(date, target); target.setTimeInMillis(time); return result; } }
TimestampWithTimezone { public static Time createTime(java.util.Date date, TimeZone initial, Calendar target) { if (target == null) { target = getCalendar(); } long time = target.getTimeInMillis(); adjustCalendar(date, initial, target); Time result = normalizeTime(date, target); target.setTimeInMillis(time); return result; }  }
TimestampWithTimezone { public static Time createTime(java.util.Date date, TimeZone initial, Calendar target) { if (target == null) { target = getCalendar(); } long time = target.getTimeInMillis(); adjustCalendar(date, initial, target); Time result = normalizeTime(date, target); target.setTimeInMillis(time); return result; }  static Calendar getCalendar(); static void resetCalendar(TimeZone tz); static Object create(java.util.Date date, TimeZone initial, Calendar target, Class<?> type); static Timestamp createTimestamp(java.util.Date date, TimeZone initial, Calendar target); static Time createTime(java.util.Date date, TimeZone initial, Calendar target); static Date createDate(java.util.Date date, TimeZone initial, Calendar target); static Time createTime(java.util.Date date); static Date createDate(java.util.Date date); static Timestamp createTimestamp(java.util.Date date); }
TimestampWithTimezone { public static Time createTime(java.util.Date date, TimeZone initial, Calendar target) { if (target == null) { target = getCalendar(); } long time = target.getTimeInMillis(); adjustCalendar(date, initial, target); Time result = normalizeTime(date, target); target.setTimeInMillis(time); return result; }  static Calendar getCalendar(); static void resetCalendar(TimeZone tz); static Object create(java.util.Date date, TimeZone initial, Calendar target, Class<?> type); static Timestamp createTimestamp(java.util.Date date, TimeZone initial, Calendar target); static Time createTime(java.util.Date date, TimeZone initial, Calendar target); static Date createDate(java.util.Date date, TimeZone initial, Calendar target); static Time createTime(java.util.Date date); static Date createDate(java.util.Date date); static Timestamp createTimestamp(java.util.Date date); static final String ISO8601_WEEK_PROP; static final boolean ISO8601_WEEK; }