Java Date Parse convertStringToDate(String dateText)

Here you can find the source of convertStringToDate(String dateText)

Description

convert String To Date

License

Apache License

Declaration

private static Date convertStringToDate(String dateText) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

import java.util.Date;

public class Main {
    private static Date convertStringToDate(String dateText) {
        DateFormat dateFormat = new SimpleDateFormat();
        try {//w w w . j a  v  a  2  s.  co m
            return dateFormat.parse(dateText);
        } catch (ParseException x) {
            throw new RuntimeException("Unable to parse string [" + dateText + "] into date.", x);
        }
    }
}

Related

  1. convertStringToDate(String dateStr, String format)
  2. convertStringToDate(String dateStr, String pattern)
  3. convertStringToDate(String dateString, String dateFormat)
  4. convertStringToDate(String dateString, String dateFormat)
  5. convertStringToDate(String dateString, String pattern)
  6. convertStringToDate(String dateTime)
  7. convertStringToDate(String dateTime)
  8. convertStringToDate(String dt)
  9. convertStringToDate(String input)