Here you can find the source of parseDateNewFormat(String sDate)
public static Date parseDateNewFormat(String sDate) throws ParseException
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public final static String newFormat = "yyyy-MM-dd HH:mm:ss"; public static Date parseDateNewFormat(String sDate) throws ParseException { DateFormat dateFormat = new SimpleDateFormat(newFormat); Date d = dateFormat.parse(sDate); return d; }//w w w .jav a2s . c o m }