Android examples for java.util:Date Parse
Parse yyyy-MM-dd hh:mm:ss format String To Date
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date StringToDate(String datestring) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); Date date = null;//from w w w . j a va 2 s. com try { date = df.parse(datestring); } catch (ParseException e) { e.printStackTrace(); } return date; } }