Android examples for java.util:Date Parse
Parse Date to String by format
import android.annotation.SuppressLint; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main{ public static Date getDateByString(String dateString, String format) { Date date = null;//from w w w.j a v a2 s. c om try { date = new SimpleDateFormat(format).parse(dateString); } catch (ParseException e) { } return date; } }