Java Parse Date parseDate(String dateString)

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

Description

parse Date

License

Open Source License

Declaration

public static final java.util.Date parseDate(String dateString) throws java.text.ParseException 

Method Source Code

//package com.java2s;

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

import java.util.Date;

import java.util.Locale;

public class Main {
    public static final java.util.Date parseDate(String dateString) throws java.text.ParseException {
        DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT);
        return df.parse(dateString);
    }// w w w .j  a  v a  2s  . c  om

    /**
     * @param inputDate
     * @param default_date_format
     * @return
     */
    public static final Date parseDate(String inputDate, String dateformat) throws ParseException {
        DateFormat df = new SimpleDateFormat(dateformat);
        return df.parse(inputDate);
    }

    public static final Date parseDate(String inputDate, String dateformat, Locale locale) throws ParseException {
        DateFormat df = new SimpleDateFormat(dateformat, locale);
        return df.parse(inputDate);
    }
}

Related

  1. parseDate(String dateStr, String format)
  2. parseDate(String dateStr, String format)
  3. parseDate(String dateStr, String... formats)
  4. parseDate(String dateString)
  5. parseDate(String dateString)
  6. parseDate(String dateString)
  7. parseDate(String dateString)
  8. parseDate(String dateString)
  9. parseDate(String dateString)