SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Date indata =new Date(); indata=format.parse(data);