Android Date String Parse parseDate(String date, String pattern)

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

Description

parse Date

Declaration

public static Date parseDate(String date, String pattern)
            throws ParseException 

Method Source Code

//package com.java2s;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static Date parseDate(String date) throws ParseException {
        if (date == null)
            return null;
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.parse(date);
    }//from   w w w.j a va 2s.  co m

    public static Date parseDate(String date, String pattern)
            throws ParseException {
        if (date == null)
            return null;
        SimpleDateFormat sdf = new SimpleDateFormat(pattern);
        return sdf.parse(date);
    }
}

Related

  1. parseDate(String atomPubDate)
  2. parseDate(String atomPubDate, Locale locale)
  3. parseDate(String date)
  4. parseDate(String date, SimpleDateFormat sdf)
  5. parseDate(String date, String format)
  6. parseDate(String date, String pattern)
  7. parseDate(String date, String pattern, TimeZone zone)
  8. parseDate(String dateValue)
  9. parseDate(String dateValue)