Here you can find the source of getDate(String time)
@SuppressLint("SimpleDateFormat") public static Date getDate(String time)
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import android.annotation.SuppressLint; public class Main { @SuppressLint("SimpleDateFormat") public static Date getDate(String time) { Date date = new Date(System.currentTimeMillis()); SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); try {// www . j a v a 2 s . co m date = format.parse(time); } catch (ParseException e) { e.printStackTrace(); } return date; } }