@Test public void testTransformDateBetweenTimeZone(){ Date startDate = new Date("07/16/2013 00:00:00"); String transformedStartDate = DateUtils.transform(startDate, dateFormat, sourceTimeZone, targetTimeZone); assertEquals(transformedStartDate, "07/16/2013 04:00:00 AM"); Date endDate = new Date("07/16/2013 23:59:59"); String transformedEndDate = DateUtils.transform(endDate, dateFormat, sourceTimeZone, targetTimeZone); assertEquals(transformedEndDate, "07/17/2013 03:59:59 AM"); }
public static String transform(Date sourceDate, DateFormat format, TimeZone sourceTimeZone, TimeZone targetTimeZone) { Long targetTime = sourceDate.getTime() - sourceTimeZone.getRawOffset() + targetTimeZone.getRawOffset(); return DateUtils.getTime(new Date(targetTime), format); }
DateUtils { public static String transform(Date sourceDate, DateFormat format, TimeZone sourceTimeZone, TimeZone targetTimeZone) { Long targetTime = sourceDate.getTime() - sourceTimeZone.getRawOffset() + targetTimeZone.getRawOffset(); return DateUtils.getTime(new Date(targetTime), format); } }
DateUtils { public static String transform(Date sourceDate, DateFormat format, TimeZone sourceTimeZone, TimeZone targetTimeZone) { Long targetTime = sourceDate.getTime() - sourceTimeZone.getRawOffset() + targetTimeZone.getRawOffset(); return DateUtils.getTime(new Date(targetTime), format); }  }
DateUtils { public static String transform(Date sourceDate, DateFormat format, TimeZone sourceTimeZone, TimeZone targetTimeZone) { Long targetTime = sourceDate.getTime() - sourceTimeZone.getRawOffset() + targetTimeZone.getRawOffset(); return DateUtils.getTime(new Date(targetTime), format); }  static String transform(Date sourceDate, DateFormat format,
			TimeZone sourceTimeZone, TimeZone targetTimeZone); static String getTime(Date date, DateFormat dateFormat); }
DateUtils { public static String transform(Date sourceDate, DateFormat format, TimeZone sourceTimeZone, TimeZone targetTimeZone) { Long targetTime = sourceDate.getTime() - sourceTimeZone.getRawOffset() + targetTimeZone.getRawOffset(); return DateUtils.getTime(new Date(targetTime), format); }  static String transform(Date sourceDate, DateFormat format,
			TimeZone sourceTimeZone, TimeZone targetTimeZone); static String getTime(Date date, DateFormat dateFormat); static final String DATE_FORMAT; }