Android Utililty Methods Timezone Change

List of utility methods to do Timezone Change

Description

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

Method

DateserverTimeStringToLocalDateTime( String serverTimeString, String serverTimeFormat)
server Time String To Local Date Time
if (serverTimeString.equals("") || serverTimeString.equals(null)) {
    return null;
SimpleDateFormat sd = new SimpleDateFormat(serverTimeFormat);
sd.setTimeZone(TimeZone.getTimeZone("UTC"));
Calendar localCal = Calendar.getInstance();
Date date = new Date();
try {
...
StringlocalDateTimeToServerTimeString( Date localDateTime, String serverTimeFormat)
local Date Time To Server Time String
if (localDateTime == null) {
    return null;
Calendar localCal = Calendar.getInstance(TimeZone
        .getTimeZone("GMT+00:00"));
localCal.setTime(localDateTime);
SimpleDateFormat sd = new SimpleDateFormat(serverTimeFormat);
sd.setTimeZone(TimeZone.getTimeZone("GMT+00:00"));
...
CalendargetLocalCalendar()
get Local Calendar
Calendar localCalendar = Calendar.getInstance(TimeZone
        .getTimeZone(TIMEZONE_CN));
return localCalendar;