Java Date Parse dateStringToDate(String dateString, String DateStringType)

Here you can find the source of dateStringToDate(String dateString, String DateStringType)

Description

date String To Date

License

Apache License

Declaration

public static Date dateStringToDate(String dateString, String DateStringType) 

Method Source Code


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

import java.util.*;

import java.text.SimpleDateFormat;

public class Main {

    public static Date dateStringToDate(String dateString, String DateStringType) {
        SimpleDateFormat formatter = new SimpleDateFormat(DateStringType);
        Date t = null;//from  w w  w.ja v  a2  s  .  c o m
        try {
            return formatter.parse(dateString);
        } catch (Exception e) {
            return t;
        }
    }
}

Related

  1. dateParser()
  2. dateParser(Date date)
  3. dateParser(String dateStr, String inputDateFormat, String outputDateFormat)
  4. dateParser(String param)
  5. dateParseShortString(Date date)
  6. dateStringToDateObject(String dateString, String dateFormat)
  7. datetime(String s)
  8. dateTime(String s)
  9. datetimeParse(String datetime)