Here you can find the source of strToDate3(String i_StrDate)
public static String strToDate3(String i_StrDate)
//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; } }