Code example for SimpleDateFormat

Methods: parseapplyPattern

0
	 *  
	 * @return The date of the update content's release. 
	 */ 
	public static Date getUpdateTime(String url) {
		//update_201204041839.zip 
		SimpleDateFormat fmt = new SimpleDateFormat();
		fmt.applyPattern("yyyyMMddHHmm");
		 
		Date time;
		try { 
			time= fmt.parse(url.substring(url.length()-16, url.length()-4));
		} catch (ParseException e) {
			time = new Date(0);
		} 
		return time;
	}/* CommonInstrumentationTest */ 
} 
Contextual code suggestions in your IDE  Get Codota for Java