Java String to Date strToDate(final String str)

Here you can find the source of strToDate(final String str)

Description

str To Date

License

Open Source License

Declaration

public static final Date strToDate(final String str) 

Method Source Code

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

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

import java.util.Date;
import java.util.Locale;

public class Main {
    public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH);

    public static final Date strToDate(final String str) {
        try {/*from w  ww.j a v a 2 s  .co  m*/
            return DATE_FORMAT.parse(str);
        } catch (ParseException e) {
            throw new RuntimeException(e.getMessage() + " Caused by " + e.getCause(), e);
        }
    }
}

Related

  1. stringToDatetime(String str, String format)
  2. stringToDatetime(String string)
  3. stringToDateTime(String stringDate, String format)
  4. stringToDateWithFormat(String stringToConvert, String dateFormat)
  5. strMSShortToDate(String str_date)
  6. strToDate(String _date, String format)
  7. strToDate(String date)
  8. strToDate(String date)
  9. strToDate(String date, String pattern)