public static Date string2Date_yyyy_MM_dd_HH_mm_ss(String strDate){
  if (TextUtils.isEmpty(strDate)) {
    return null;
  }
  SimpleDateFormat sdf=getSimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  try {
    return sdf.parse(strDate);
  }
 catch (  ParseException e) {
    e.printStackTrace();
  }
  return null;
}

public static Date string2Date_yyyy_MM_dd_HH_mm_ss ( String strDate ) { if ( TextUtils . isEmpty ( strDate ) ) { return null ; } SimpleDateFormat sdf = getSimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; try { return sdf . parse ( strDate ) ; } catch ( ParseException e ) { e . printStackTrace ( ) ; } return null ; }
get datetime by date string which formatted with yyyy - mm - dd hh : mm : ss
