Android Utililty Methods Timezone Date Format

List of utility methods to do Timezone Date Format

Description

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

Method

StringformatTime(Context context, Date date, TimeZone timeZone)
Formats the given time according to the user's preference, and using the given time zone.
DateFormat timeZoneTimeFormat = sTimeZoneTimeFormats.get(timeZone
        .getID());
if (timeZoneTimeFormat == null) {
    timeZoneTimeFormat = android.text.format.DateFormat
            .getTimeFormat(context);
    timeZoneTimeFormat.setTimeZone(timeZone);
    sTimeZoneTimeFormats.put(timeZone.getID(), timeZoneTimeFormat);
return timeZoneTimeFormat.format(date);
StringgetCurrentTimeForTimezone(Context context, String timezone)
Formats the current time according to the user's preference, and using the given time zone.
return formatTime(context, new Date(),
        TimeZone.getTimeZone(timezone));
DategetDateTimeForTimeZone(String str)
get Date Time For Time Zone
SimpleDateFormat df = new SimpleDateFormat(DATE_TIME_FORMAT);
Long time = new Date(df.parse(str).getTime()).getTime();
return getDateTimeForTimeZone(time);