Java String to Date stringToDate(String dateString)

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

Description

string To Date

License

Open Source License

Declaration

public static Date stringToDate(String dateString) 

Method Source Code


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

import java.text.*;
import java.util.*;

public class Main {
    private static DateFormat df = new SimpleDateFormat("yyyy-MM-dd");

    public static Date stringToDate(String dateString) {
        Date date = null;//from   ww w  . j  ava2  s  .  c  om
        try {
            date = df.parse(dateString);
        } catch (ParseException e) {
            throw new RuntimeException(e);
        }
        return date;
    }
}

Related

  1. stringToDate(String dateString)
  2. stringToDate(String dateString)
  3. stringToDate(String dateString)
  4. stringToDate(String dateString)
  5. stringToDate(String dateString)
  6. stringToDate(String dateString, String dataFormat)
  7. stringToDate(String dateString, String dateFormat)
  8. stringTodate(String dateString, String format)
  9. stringToDate(String dateString, String formatStr)