Android Date String to Date Convert getDate(String date)

Here you can find the source of getDate(String date)

Description

get Date

Declaration

public static Date getDate(String date) throws ParseException 

Method Source Code

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import android.util.Log;

public class Main{
    public static Date getDate(String date) throws ParseException {
        DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        Date d = formatter.parse(date);
        Log.v(DateUtil.class.getName(), d.toString());
        return d;
    }/*from   w ww . j a  v  a2s .c o  m*/
}

Related

  1. parseStringToDate(String dateString, String sourceDateFormat, Locale locale)
  2. parse2Date(SimpleDateFormat s, Object d)
  3. stringToDate(String src, String format)
  4. toDateFromLongFormat(String date)
  5. parse(String aFormat, String date)
  6. getDateFromString(String dateStr, String pattern)
  7. getDateFromString(String string)
  8. getDateObj(String argsDate, String split)
  9. getDateOffset(String date, int offset)