Here you can find the source of getDateByTime(String time)
public static Date getDateByTime(String time)
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import android.text.TextUtils; public class Main { public static Date getDateByTime(String time) { SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); Date date;//from www . j av a2 s. c o m try { if (TextUtils.isEmpty(time)) { return null; } date = sdf.parse(time); return date; } catch (ParseException e) { e.printStackTrace(); return null; } } }