Code example for SimpleDateFormat

Methods: parsesetLenient

0
	} 
 
	public final static Date string2Time(String dateString) throws java.text.ParseException {
 
		DateFormat dateFormat;
		dateFormat = new SimpleDateFormat("yy-MM-dd", Locale.CHINESE);
		dateFormat.setLenient(false);
		Date timeDate = dateFormat.parse(dateString);
		Date dateTime = new Date(timeDate.getTime());
		return dateTime;
	} 
 
	/** 
	 * 增加抵用券 
	 *  
	 * @return 
	 * @throws ParseException 
	 */ 
	@Action(value = "addVoucherst", results = {  
			@Result(name = "json",type="json") 
Stop searching for code, let great code find you!  Add Codota to your java IDE