Android Utililty Methods Timezone Get

List of utility methods to do Timezone Get

Description

The list of methods to do Timezone Get are organized into topic(s).

Method

TimeZonegetGmtTimeZone()
Returns the GMT time zone
return TimeZone.getTimeZone("GMT");
voidsetDefaultTimeZoneToVietnam()
set Default Time Zone To Vietnam
TimeZone.setDefault(TimeZone.getTimeZone("GMT+7"));
StringgetLocalDateTimeFromString(String gmtString, String orgFormat, String format)
get Local Date Time From String
final Date date = getDateTimeFromString(gmtString, orgFormat);
final Date local = new Date(date.getTime()
        + TimeZone.getDefault().getOffset(date.getTime()));
SimpleDateFormat formatter = new SimpleDateFormat(format);
return formatter.format(local);
TimeZonegetTimeZone()
get Time Zone
if (TIME_ZONE_OFFSET > 0) {
    return TimeZone.getTimeZone("GMT+" + TIME_ZONE_OFFSET);
if (TIME_ZONE_OFFSET < 0) {
    return TimeZone
            .getTimeZone("GMT-" + Math.abs(TIME_ZONE_OFFSET));
return TimeZone.getTimeZone("GMT+0");
...