List of usage examples for java.util Calendar set
public final void set(int year, int month, int date, int hourOfDay, int minute, int second)
YEAR
, MONTH
, DAY_OF_MONTH
, HOUR_OF_DAY
, MINUTE
, and SECOND
. From source file:com.collabnet.ccf.core.utils.DateUtil.java
public static Date convertToGMTAbsoluteDate(Date dateValue, String sourceSystemTimezone) { Calendar cal = new GregorianCalendar(TimeZone.getTimeZone(sourceSystemTimezone)); cal.setLenient(false);/* w w w .jav a 2 s. co m*/ cal.setTime(dateValue); Calendar newCal = new GregorianCalendar(TimeZone.getTimeZone(GMT_TIME_ZONE_STRING)); newCal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0); newCal.set(Calendar.MILLISECOND, 0); Date returnDate = newCal.getTime(); return returnDate; }