Android examples for java.util:Date Parse
parse string to Date by timezone
import android.annotation.SuppressLint; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.TimeZone; public class Main{ public static Date parse(String format, String date, TimeZone timeZone) throws ParseException { SimpleDateFormat df = new SimpleDateFormat(format, Locale.ENGLISH); df.setTimeZone(timeZone);/*from www.j av a 2s. c om*/ return df.parse(date); } public static Date parse(String format, String date) throws ParseException { return parse(format, date, TimeZone.getTimeZone("UTC")); } }