Java String to Date getStringToDateTime(String dateStr, String formatStr)

Here you can find the source of getStringToDateTime(String dateStr, String formatStr)

Description

get String To Date Time

License

Apache License

Declaration

public static Date getStringToDateTime(String dateStr, String formatStr) throws Exception 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static Date getStringToDateTime(String dateStr, String formatStr) throws Exception {
        SimpleDateFormat format = new SimpleDateFormat(formatStr);
        Date date = null;/*from   w w w  . ja va 2s  .c o m*/

        date = format.parse(dateStr);
        return date;
    }
}

Related

  1. getStringToDate(String date, String format)
  2. getStringToDate(String date, String inputDateFormat)
  3. getStringToDate(String pValue, String pDateFormat)
  4. getStringToDate(String str)
  5. getStringToDateFull(String da)
  6. getTodateString()
  7. humanDateToDate(String date)
  8. LongToDateString(long l)
  9. longToDateString(long l)