Code example for SimpleDateFormat

Methods: parse

0
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 
			//e.printStackTrace(); 
		} 
		return newDate;
	} 
	 
	public static void browseDirectory(String path) {
	    File file = new File(path);