Java String to Date stringToDate(String s)

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

Description

string To Date

License

Open Source License

Declaration

public static Date stringToDate(String s) throws ParseException 

Method Source Code

//package com.java2s;

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

import java.util.Date;

public class Main {
    public static final String DATE_FORMAT = "yyyy/MM/dd";

    public static Date stringToDate(String s) throws ParseException {
        SimpleDateFormat sd = new SimpleDateFormat(DATE_FORMAT);
        Date date = sd.parse(s);/*from  www. ja v  a  2  s. c om*/
        return date;
    }
}

Related

  1. StringToDate(String format, String dateStr)
  2. stringToDate(String input)
  3. stringToDate(String pstrValue, String pstrDateFormat)
  4. StringToDate(String s)
  5. stringToDate(String s)
  6. StringToDate(String s)
  7. stringToDate(String s, DateFormat formatter)
  8. stringToDate(String s, String format)
  9. stringToDate(String sDate)