List of utility methods to do Timezone Date Format
String | formatTime(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); |
String | getCurrentTimeForTimezone(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)); |
Date | getDateTimeForTimeZone(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); |