Java String to Date strDateConvertToDate(String strDate, String fFormatStr)

Here you can find the source of strDateConvertToDate(String strDate, String fFormatStr)

Description

str Date Convert To Date

License

Apache License

Declaration

public static Date strDateConvertToDate(String strDate, String fFormatStr) 

Method Source Code

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

import java.text.ParseException;

import java.util.Date;

public class Main {

    public static Date strDateConvertToDate(String strDate, String fFormatStr) {
        java.util.Date birthday = new java.util.Date();
        java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(fFormatStr);
        try {/*from  w w w  . j  a va 2s  .  com*/
            birthday = sdf.parse(strDate);
            return birthday;
        } catch (ParseException e) {
            e.printStackTrace();
            return null;
        }
    }
}

Related

  1. putTimeStr14ToDate(String dateTimeStr)
  2. putTimeStr19ToDate(String dateTimeStr19)
  3. rfc3339ToDate(String s)
  4. SortStringToDate(String thisdate, Locale locale)
  5. strChangeToDate(String str)
  6. stringArrayTODateArray(String[] dates_s, SimpleDateFormat dateformat)
  7. stringDateToDate(String str)
  8. stringDateToDate(String StrDate)
  9. stringFechaToDate(String fechaS)