Android Date String Parse convertToDate(String dateString)

Here you can find the source of convertToDate(String dateString)

Description

convert To Date

Declaration

public static String convertToDate(String dateString) 

Method Source Code

//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static String convertToDate(String dateString) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MMMM-yy");
        Date convertedDate = new Date();
        try {/*from   w ww.ja  v a  2  s.  c  o  m*/
            convertedDate = dateFormat.parse(dateString);

        } catch (ParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return convertedDate.toLocaleString();
    }
}

Related

  1. parseDate(CharSequence input, String pattern, Date defaultDate)
  2. convertDate(String YearMonthDay)
  3. convertDateStringToDash(String MonthDayYear)
  4. convertDateStringToLong(String date, String format)
  5. convertDateTime( String YearMonthDayHourMinuteSeconds)
  6. getDateFromString(String format, String dateString)
  7. getDateFromLJString( String dateString)
  8. getDateFromString(String dateString)
  9. parseRFC3339Date(String date)