Android Date String Parse parseDate(String date)

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

Description

parse Date

Declaration

public static Date parseDate(String date) 

Method Source Code

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

import java.util.Date;

public class Main {
    public static String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";

    public static Date parseDate(String date) {
        try {//  w w w.ja v  a 2 s.c  om
            SimpleDateFormat dateFormat = new SimpleDateFormat(
                    DEFAULT_DATE_FORMAT);
            return dateFormat.parse(date);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return new Date();
    }
}

Related

  1. parseSearchApiDateTime(String dateString)
  2. parseString(String dateStr)
  3. parseString(String dateStr, String pattern)
  4. parseStringToDate(String str)
  5. parseTM(String s, boolean end)
  6. parse(String dateStr)
  7. parse(String input)
  8. parse(String source, String pattern)
  9. parseDate(String value, String[] parsePatterns)