Java String to Date stringToDate(String s, String format)

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

Description

string To Date

License

Apache License

Declaration

public static Date stringToDate(String s, String format) throws ParseException 

Method Source Code


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

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {

    public static Date stringToDate(String s, String format) throws ParseException {
        return new SimpleDateFormat(format).parse(s);
    }/*from w w w  .j a  v a  2 s  .c  om*/
}

Related

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