Android examples for java.util:Timezone
transform Time in java.util.Date from one timezone to another timezone
import java.util.Date; import java.util.TimeZone; public class Main { public static Date transformTime(Date date, TimeZone oldZone, TimeZone newZone) { Date finalDate = null;/*from w w w .ja v a 2s . c om*/ if (date != null) { int timeOffset = oldZone.getOffset(date.getTime()) - newZone.getOffset(date.getTime()); finalDate = new Date(date.getTime() - timeOffset); } return finalDate; } }