Android Utililty Methods Date to GMT Date Convert

List of utility methods to do Date to GMT Date Convert

Description

The list of methods to do Date to GMT Date Convert are organized into topic(s).

Method

DatelocalDateFromGMTDate(Date dateGMT)
local Date From GMT Date
Calendar calendarMGT = Calendar.getInstance();
calendarMGT.setTimeInMillis(dateGMT.getTime());
Calendar calendarLocal = (Calendar) calendarMGT.clone();
TimeZone z = TimeZone.getDefault();
int offset = z.getRawOffset();
int offsetHrs = offset / 1000 / 60 / 60;
int offsetMins = offset / 1000 / 60 % 60;
calendarLocal.add(Calendar.HOUR_OF_DAY, (offsetHrs));
...