Here you can find the source of parse(final String s)
public static Date parse(final String s)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public static Date parse(final String s, final String fmt) { SimpleDateFormat sdf = new SimpleDateFormat(fmt); try {/* w w w .j a v a2 s. co m*/ return sdf.parse(s); } catch (ParseException e) { } return null; } public static Date parse(final String s) { try { return sdf1.parse(s); } catch (ParseException e) { } return null; } }