Here you can find the source of parseDate(String date, String format)
public static Date parseDate(String date, String format)
//package com.java2s; /**//from w w w .j a v a 2 s. c om * Mule Google Api Commons * * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date parseDate(String date, String format) { DateFormat df = new SimpleDateFormat(format); try { return df.parse(date); } catch (ParseException e) { throw new IllegalArgumentException( String.format("Could not parse date %s with format %s", date, format)); } } }