Here you can find the source of getDateFromString(String dateString)
@SuppressLint("SimpleDateFormat") public static Date getDateFromString(String dateString)
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import android.annotation.SuppressLint; import android.text.TextUtils; public class Main { private static final String DATE_FORMAT = "EEE, d MMM yyyy HH:mm:ss Z"; @SuppressLint("SimpleDateFormat") public static Date getDateFromString(String dateString) { if (!TextUtils.isEmpty(dateString)) { SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); try { return sdf.parse(dateString); } catch (ParseException e) { e.printStackTrace();/*from w w w . ja va 2 s. com*/ } } return null; } }