Code example for SimpleDateFormat

Methods: parse

import java.util.Locale; 
public class Util { 
	public static Date stringToDate(String dateString) {
		DateFormat sdFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZZZ yyyy", Locale.ENGLISH);
		dateString = dateString.replaceAll("\\p{Cntrl}", "");
		Date newDate = null;
		try { 
			newDate = sdFormat.parse(dateString);
		} catch (ParseException e) {
			// TODO Auto-generated catch block 
		return newDate;
	public static void browseDirectory(String path) {
	    File file = new File(path);
Connect your IDE to all the code out there  Get Codota for Java