Java Parse Date parseDate(String date, String format)

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

Description

parse Date

License

Open Source License

Declaration

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

Method Source Code


//package com.java2s;
//License from project: Open Source License 

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

import java.util.Date;

public class Main {
    public static Date parseDate(String date) throws ParseException {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        return df.parse(date);
    }//from   ww  w .  jav  a  2 s  .com

    public static Date parseDate(String date, String format) throws ParseException {
        SimpleDateFormat df = new SimpleDateFormat(format);
        return df.parse(date);
    }
}

Related

  1. parseDate(String date)
  2. parseDate(String date, Locale locale)
  3. parseDate(String date, String expression)
  4. parseDate(String date, String format)
  5. parseDate(String date, String format)
  6. parseDate(String date, String format)
  7. parseDate(String date, String format)
  8. parseDate(String date, String pattern)
  9. parseDate(String date, String pattern)