Android examples for java.util:Timezone
format date by timezone
import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main{ public static String format(String format, Date date, TimeZone timeZone) { SimpleDateFormat df = new SimpleDateFormat(format); df.setTimeZone(timeZone);/*from w w w . j a va 2 s . c o m*/ return df.format(date); } public static String format(String format, Date date) { return format(format, date, TimeZone.getTimeZone("UTC")); } }