Code example for ParseException

Methods: getMessage

0
		SimpleDateFormat dformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		try { 
			date = dformat.parse(dateString);
			//its normal having an parsing exception here, for instance, with "No Credit" as string 
		} catch (ParseException parseException) {
			Log.i(LOG_TAG, parseException.getMessage());
			return null;			 
		} 
		return date;
	} 
	 
	/** 
	 * Parse any date into string format yyyy/MM/dd-HH:mm:ss  
	 * @param date 
	 * @return String date 
	 */ 
	private static String dateToString(Date date){		
		SimpleDateFormat dformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return dformat.format(date);
		 
	}