Code example for TimeZone

Methods: getOffset

0
    } 
     
    @Deprecated 
	public static Date adjustRelativeDateToUtcDate(Date relDate, TimeZone relTimeZone) {
		if (null == relDate || null == relTimeZone) return null;
		int relOffsetMs = relTimeZone.getOffset(relDate.getTime());
		Calendar relCal = Calendar.getInstance();
		relCal.setTime(relDate);
		relCal.add(Calendar.MILLISECOND, (-1*relOffsetMs));
		return relCal.getTime();
	} 
} 
Contextual code suggestions in your IDE  Get Codota for Java