List of utility methods to do Date Timezone Change
Date | localDateToUTC(Date dtLocal) local Date To UTC if (dtLocal == null) return null; TimeZone tz = TimeZone.getDefault(); int currentOffsetFromUTC = tz.getRawOffset() + (tz.inDaylightTime(dtLocal) ? tz.getDSTSavings() : 0); return new Date(dtLocal.getTime() - currentOffsetFromUTC); |
Date | toLocalDate(Date gmtDate) to Local Date return new Date(); |