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.*;

public class Main {
    public static Date StringToDate(String s, String pattern) throws ParseException {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
        return simpleDateFormat.parse(s);
    }/*  www . j  a v a2s .  co m*/

    public static Date StringToDate(String s) throws ParseException {
        return StringToDate(s, "yyyy-MM-dd hh:mm:ss");
    }
}

Related

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