Java Date Parse getDateFromString(String input, String format)

Here you can find the source of getDateFromString(String input, String format)

Description

get Date From String

License

Open Source License

Declaration

public static Date getDateFromString(String input, String format) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static Date getDateFromString(String input, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        try {//  w w  w.  ja  v  a2s.c  o m
            return sdf.parse(input);
        } catch (Exception ex) {
            return null;
        }
    }
}

Related

  1. getDateFromString(String dateString)
  2. getDateFromString(String dateString)
  3. getDateFromString(String dateString)
  4. getDateFromString(String dateString, String format)
  5. getDateFromString(String dateString, String format)
  6. getDateFromString(String iso, String format)
  7. getDateFromString(String string)
  8. getDateFromString(String stringDate, String format)
  9. getDateFromStringTest(String date)