@Test public void testDateToDateConversion1() { Date t = Date.valueOf("2004-06-30"); Date converted = TimestampWithTimezone.createDate(t, TimeZone.getTimeZone("America/Chicago"), Calendar.getInstance(TimeZone.getTimeZone("GMT"))); Calendar cal = Calendar.getInstance(); cal.setTime(converted); assertEquals(0, cal.get(Calendar.MILLISECOND)); }
public static Date createDate(java.util.Date date, TimeZone initial, Calendar target) { if (target == null) { target = getCalendar(); } long time = target.getTimeInMillis(); adjustCalendar(date, initial, target); Date result = normalizeDate(date, target); target.setTimeInMillis(time); return result; }
TimestampWithTimezone { public static Date createDate(java.util.Date date, TimeZone initial, Calendar target) { if (target == null) { target = getCalendar(); } long time = target.getTimeInMillis(); adjustCalendar(date, initial, target); Date result = normalizeDate(date, target); target.setTimeInMillis(time); return result; } }
TimestampWithTimezone { public static Date createDate(java.util.Date date, TimeZone initial, Calendar target) { if (target == null) { target = getCalendar(); } long time = target.getTimeInMillis(); adjustCalendar(date, initial, target); Date result = normalizeDate(date, target); target.setTimeInMillis(time); return result; }  }
TimestampWithTimezone { public static Date createDate(java.util.Date date, TimeZone initial, Calendar target) { if (target == null) { target = getCalendar(); } long time = target.getTimeInMillis(); adjustCalendar(date, initial, target); Date result = normalizeDate(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 Date createDate(java.util.Date date, TimeZone initial, Calendar target) { if (target == null) { target = getCalendar(); } long time = target.getTimeInMillis(); adjustCalendar(date, initial, target); Date result = normalizeDate(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; }