Java String to Date strToDate3(String i_StrDate)

Here you can find the source of strToDate3(String i_StrDate)

Description

str To Date

License

Open Source License

Declaration

public static String strToDate3(String i_StrDate) 

Method Source Code

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

import java.text.*;

public class Main {
    public static final SimpleDateFormat SDF_FULL = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static String strToDate3(String i_StrDate) {
        try {//from w  w w  . j av  a2 s . c  om
            if (i_StrDate == null || "".equals(i_StrDate.trim())) {
                return "";
            }

            java.util.Date d = SDF_FULL.parse(i_StrDate);
            return SDF_FULL.format(d);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return null;
    }
}

Related

  1. strToDate(String strDate)
  2. strToDate(String strDate)
  3. strToDate(String strDate)
  4. strToDate(String strDate, String format)
  5. strToDate(String time, String format)
  6. strToDateM6(String StrToDate)
  7. StrToDateSeco(String str)
  8. strToDatetime(String sStr)
  9. strToDateWithFormat(String strDate, Format format)